Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is use of dcb parameter in dd statement?

1238


What is the use of symbol // in jcl?

1392


Explain in DD statement what is the use of DCB parameter?

1081


What are some jcl statements that are not allowed in procedures?

1175


Explain the function of job statement in jcl?

1129


when can a job time-out occur? How to overcome that?

1216


Explain the function of the steplib dd statement?

1071


What are the parameter we cannot use in procedure?

1056


which utility is used to sort a file in jcl?

1173


Can we call instream to catalog and catalog to instream?

1086


what is DSN parameter and DISP parameter is used for?

1099


Explain the function of the dd dcb keyword?

1182


Explain how can a stopped job be started again?

1080


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

1192


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?

1058