How to identify where file is empty or not? How many ways are
there to identifying?
Answer Posted / swapnilkumar
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 |
Post New Answer View All Answers
Explain the function of job statement in jcl?
What are the 4 fields in dd statement?
How to pass data to a program that is coded in an exec statement?
Mention the types of job control statements?
1) SORT FIELDS=(20,4,CH,D,10,3,CH,D) OUTREC FIELDS=(7:20,4,C' FUTURE ',20,2,10,3,1Z,1,9,13,7, 24,57,TRAN=LTOU,6X'FF') This example illustrates how a fixed-length input data set can be sorted and reformatted for output. The SORTIN LRECL is 80 bytes. The reformatted output records are fixed length with a record size of 103 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 103. in the above example i have some doubts that a) sort fields=(20,4,CH,D,10,3,CH,D) -what exactly it does and this fields related to output record fields or input record fields b)outrec used to refprmat the records after sorting that means could please reply me as soon as possible Thanks. Venkat
WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375
how to do automated restart when a job abends?
which utility is used to sort a file in jcl?
Are there any set of rules for the names of the steps used in a job? What are they?
How to execute 2nd and 4th steps among 5 steps in jcl proc?
What are the parameter we cannot use in procedure? How many instream we can write in single jcl?
Does jcl support automatic restart?
Explain the function of //cntl statement?
How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?
Name the statement which can be used to send data to another mvs jes3 node?