There are two steps in a JCl, the first one generates a
report while the second step send an email saying the
report has been generated, but the second steps should only
be executed when the report file is non-empty. How can it
be acheived. We may include steps in between.

Answer Posted / abhijit18in2002

Insert a IDCAMS step between the two step here is the Eg


//STEP01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=MY.SORT.FILE1,DISP=SHR
//SYSUT2 DD DSN=MY.SORT.FILE2,DISP=SHR
//SYSIN DD DUMMY
//*

//* Checking the File for any data
//*

//CHEKEMTY EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//MYFILE DD DSN=MY.SORT.FILE2,DISP=SHR
//SYSIN DD *
PRINT INFILE(MYFILE) CHARACTER COUNT(1)
//*

//* If above step gives RC=04 it means file1 is empty
//* so STEP02 would only execute if step CHEKEMTY has
//* RC Not equal to 04.

//STEP02 EXEC PGM=SASSTRLR,
// PARM='INACT',COND=(04,EQ,CHEKEMTY)
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
DEMAND ABCXYZ
//*

Is This Answer Correct ?    25 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can an individual step be restricted from using all the jobs allowed cpu time?

1009


Explain the function of the steplib dd statement?

647


How can an in-stream dataset be terminated?

848


Can I share my data with other jobs? How?

670


What is the purpose of dd * statement in jcl?

812






How dummy is used in jcl?

651


How can the disposition of sysout datasets be set for an entire jobstream?

840


what sort card you will use to copy the data from one dataset to another dataset?

730


In sms datasets, what is the function of the dd mgmtclas keyword?

863


which utility is used to sort a file in jcl?

750


Can we call instream to catalog and catalog to instream?

685


what are JCLLIB and STEPLIB in JCL?

677


What are the parameters that are used in creating a gdg?

741


What are the 4 fields in dd statement?

744


What parameter directs the output of the job log dataset?

766