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
How does jcl act on a cobol code?
How does jcl specify the job to the operating system?
What is Cataloged Procedures?
How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you
What is the function of //jcllib statement?
How to submit jcl through a cobol program?
In job processing, what happens in execution stage?
How jcl is used for testing batch programs?
Is there any command to check wether the ps file is in sorted order?
I need exexution process for JCL programs
write a jcl to execute a job by 7:00 am on jan 20,1986?
What is the purpose of dd?
What is the function of dd disp parameter?
if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?
Differentiate between the joblib and the steplib statements?