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 methodology can be adapted to transfer data to a program that is coded using the exec statement?
Can an individual step be restricted from using all the jobs allowed cpu time?
What is the use of disp parameter?
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?
how do you access an uncataloged dataset in a jcl?
Why block size is multiple of lrecl in jcl?
define cond parameter in jcl?
What are the parameter we cannot use in procedure?
why should SYSIN DD * statement should not be included inside a PROCedure snippet??? please answer this.. i need to know.
when does a dataset go uncataloged?
We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?
What is notcat 2 - gs?
What are the rules employed while naming the steps in a job?
Explain the function of //cntl statement?
What is one line to pass PARM from JCL to COBOL?