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 EXEC statement is and what is the syntax of EXEC statement used in JCL?
Name the parameters which can be used to limit the number of records written to a sysout dataset?
in order to execute step2 a job after a return code of 8 in step1, what condition you will code in step2?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?
How do you submit a job for execution?
I have 60 steps in the JCL and want to Execute Only First from PROC by overriding in JCL ?
How to run cobol program using jcl?
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.
In sms datasets, what is the function of the dd mgmtclas keyword?
What does a disposition of (MOD,DELETE,DELETE) mean ?
what is the use of IEBGENER utility?
What is job control language?
How can the attributes of one sms dataset be copied to another dataset?
What is jcl in mainframe?
What are the parameter we cannot use in procedure? How many instream we can write in single jcl?