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
Where can program checkpoints be stored for use in a restart?
Explain how can the submitting users racf authority be overridden in a job stream?
Is their any limit for data sets?
what is the use of IEBGENER utility?
Is automatic restart possible in jcl? If yes, how?
How can unused space allocation be returned to the system when a dataset is closed?
What is the maximum length of a single line of jcl?
Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?
For what purpose steplib and joblib are used ?
How jcl work to handle various input output file operations?
What are s0c1, s0c4, s0c5, s0c7 and socb?
Explain the purpose of dd dummy statement?
Explain in DD statement what is the use of DCB parameter?
what sort card you will use to copy the data from one dataset to another dataset?
Explain about LMQUERY�give a dialog information about a data set