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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sreedhar naidu dhekodna
In the above Question there are no details about how the
file is getting created say, whether they are creating a
file using a program which may or may not populate data
into the file or using some IBM utilities for the sake of
only creation of file.
Consider the first Case: If file is getting created in a
step where the program may or maynot populate the file,
Then we can use IDCAMS or INSYNC or FILEAID or some
other utilities to check the emptiness of a file.
If it is the other case: Using file creation utilities only
for the sake of creation then only we can use cond
parameter.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / vinay sonar
If file is empty you will get return code 4.
So put always true confition COND=(4,EQ) in step2.
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / reader
when we are creating the file in step-1 then obviuosly the
file will be empty only..then why we need to check the
condition and skip the step..directly we can put COND=
(4,Lt) parameter and we can skip the step-2...
correct me if im wrong...
Is This Answer Correct ? | 5 Yes | 14 No |
what is d/f b/w sysout & sysprint
you have one jcl .in sort step 5 files are there.if out of 5 files if one file is uncataloged or not there then how will you correct your jcl so that problem does not come. you should not create this file externally.how will u overcome it.
Which dd parameters are required?
suppose i have 10 job steps and i want to execute only step 6.How to write?
wht is step lib n job lib ? where can we code joblib n steplib ?
Name a few IBM utility programs, and explain its function.
What is the use of disp parameter?
Can I copy the FB (fixed Block) record length file to a VB (variable Block)record length file and Vise Versa? If Yes then how ? is that thru one of the JCL utility ?
How many instream we can write in single jcl?
in ways data can be passed to a COBOL program from JCL?
in a series of 10 steps, i need to run only 1,3,5,7 & 9th steps only. how do u code?
wht happens if blksize = 0 and lrec = 0 ?