How to identify where file is empty or not? How many ways are
there to identifying?
Answers were Sorted based on User's Feedback
Answer / bala
1) Use IDCAMS
SYSIN DD *
PRINT INDATASET(file name) COUNT(1)
gives RC 04 if the file is an empty file.
2)Compare the file with a known empty file using IEBCOMPR
utility. Comparing two empty files gives Nonzero RC
| Is This Answer Correct ? | 6 Yes | 1 No |
There are two ways to check for the file empty or not.
1) With FILEAID
2) With IEBPTPCH
//STEPXX EXEC PGM=FILEAID
//DD01 DD DSN=P1.SEQUEN.INPUT.FILE,DISP=SHR
//DD01O DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
other is
//STEPXX EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=P1.SEQUEN.INPUT.FILE,DISP=SHR
//SYSUT2 DD DUMMY
//SYSIN DD DSN=SYS1.CTLLIB(P1CTL),DISP=SHR
where CTL card has
PRINT TYPORG=PS,CNTRL=1
The either of above step gets RC=04 then the file is empty
else if its zero then file has some data in it.
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / fred
There are so many ways this can be done.
DFSORT/SYNCSORT
ICETOOL/SYNCTOOL
IDCAMS
FILEAID/FILEMANAGER
IEBPTPCH
ISRSUPC
EASYTRIEVE
Using REXX checking with EXECIO / LISTDSI
Using SORT is the easiest:
//jobcard
//S010 EXEC PGM=SORT,PARM='NULLOUT=RC4'
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=<datasetname>
//SORTOUT DD DUMMY
//SYSIN DD *
SORT FIELDS=COPY
/*
-- RC 4 if Empty
RC 0 if there is data.
| Is This Answer Correct ? | 1 Yes | 2 No |
How to release the Output HELD by using HOLD = YES on DD statement ?
//ERFDS JOB //STEP1 //STEP2 //STEP3...COND=(4,LT) //STEP4 1.CONDITION IN STEP3 REFERS TO WHICH STEP'S RETURN CODE (STEP1 OR STEP2)? 2.IN ABOVE PROGRAM IF CONDITION SATISFIES IN STEP3 WHICH STEPS WILL EXECUTE?? AND WHY? IF CONDITION IN STEP3 SATISFIES
Can we give TIME = (1440, 59) also ? or is TIME = (1439, 59) is the last one ?
How to get cursor position from system in CICS environment ?
I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?
How do you access a file that had a disposition of KEEP?
you have one jcl .in sort step 5 files are there.if out of 5 files if one file is uncataloged or not there then how will you correct your jcl so that problem does not come. you should not create this file externally.how will u overcome it.
how to increase the space of a dataset in instream procedure.
How to see the COMP3 value(packd decimal)
Explain about ISPFTTRC
jcl is like a complier....?
i have step1,step2,step3 from where can i start coding cond parameter ?