Suppose i have 2 steps in my pgm. Step1- creates a file,
Step2 - generates report from file in step1, What changes
have to be made in Step2, so that if the file in Step1 is
empty Step2 should not be executed? No changes to be made to
Step1.
Answer Posted / reddy
After step1,before step2 , create another step , say stepA.
in step a , cheCk for the file in step1 is empty or not
using the IDCAMS utility
//STEP1 EXEC PGM=PG1
//DD1 DD DSN=TPAR.T01.A,DISP=(NEW,CATLG,DELETE),
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
SPACE=(TRK,(5,5),RLSE),UNIT=PROD
//STEPA EXEC PGM=IDCAMS
//DD2 DD DSN=TPAR.T01.A,DISP=SHR
//SYNID DD *
PRINT INFILE(DD2) COUNT (1)
END
//IF (RC.STEPA = 4) THEN
//STEP2 EXEC PGM=REPORT
//DD3 DD DSN = XXX.XX.XX
//ELSE
//STEP3 EXEC PGM=PGM2
//ENDIF
if the file is empty , stepa will return 0 else it
reuns 4. If your file consists of the header and trailer
give count(3).
| Is This Answer Correct ? | 20 Yes | 1 No |
Post New Answer View All Answers
what is use of dcb parameter in dd statement?
What is the use of symbol // in jcl?
Explain in DD statement what is the use of DCB parameter?
What are some jcl statements that are not allowed in procedures?
Explain the function of job statement in jcl?
when can a job time-out occur? How to overcome that?
Explain the function of the steplib dd statement?
What are the parameter we cannot use in procedure?
which utility is used to sort a file in jcl?
Can we call instream to catalog and catalog to instream?
what is DSN parameter and DISP parameter is used for?
Explain the function of the dd dcb keyword?
Explain how can a stopped job be started again?
How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step?