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



Suppose i have 2 steps in my pgm. Step1- creates a file, Step2 - generates report from file in step..

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

Suppose i have 2 steps in my pgm. Step1- creates a file, Step2 - generates report from file in step..

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

Suppose i have 2 steps in my pgm. Step1- creates a file, Step2 - generates report from file in step..

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

Suppose i have 2 steps in my pgm. Step1- creates a file, Step2 - generates report from file in step..

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

Post New Answer

More JCL Interview Questions

How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?

0 Answers  


proc1,proc2,up to proc5 is there if i want to call proc1 and proc5how can u write the code

2 Answers  


How does the jcl specify the job to os?

0 Answers  


SORT card to eliminate duplicity.

1 Answers   Syntel,


What are the 2 types of parameters in dd statement?

0 Answers  






i have job card like this //job ***** //step1 exec pgm=iebgener //sysut1 dd dsn=main.sss,disp=shr // dd dsn=main1.sss,disp=shr // dd dsn=main2.sss,disp=shr //sysut2 dd dsn=out1.mmm ,disp=(new,catlg,delete) dcb=( ) // sysin dd * like this what i have to do to skip dsn=main1.sss please giveme answer asap

2 Answers   IBM, TetraSoft,


What is the error in the following JCL statements : I) //step#three exec pgm=hkbc762 ii) //step#3 exec pgm = hkbc762 iii) //step#3 exec pgr = hkbc672

6 Answers  


I have 5 steps in my jcl ,I need to execute first three steps and then 2nd step again ,4th and 5th steps if rc of 2nd step is zero

1 Answers   ABC,


We are aware of eliminating the duplicate records from outyput fiel using sort utility. Can we get the duplicate records in to another file in the Same sort utility?

2 Answers  


if we are specifing joblib as well as steplib in job then at the time of execution how the process will complete

4 Answers  


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

0 Answers  


How to execute step2,step5,step7 of a proc of 10 steps? You are not allowed to change in JCL.

3 Answers   IBM,


Categories