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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / squid
Just my thought -
You can set a code in your cobol program that writes the
report file to set a certain "return code" in the RETURN-
CODE field before exiting the program.
Depending on that return code from the program, you can
code IF END IF in your JCL.
Please let me know if that is wrong.
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / madhan
Use IEBPTPCH utility to verify the records in the input
file. if you get other than zero return code (2 or 4), then
there is no records in the input file(input file is empty).
based on the return code from the step1, step2 will execute
otherwise skip step2.
Is This Answer Correct ? | 1 Yes | 3 No |
How do you submit a job for execution?
What is MOD and when would you use it?
How can you trap abends in the JCL?
if we compile the cobol+ db2 program now ofter 5 years we need to compile again?
i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?
wht happens if blksize = 0 and lrec = 0 ?
How many types of libraries are there in JCL ?
Describe the various parameters utilized in the creation of a gdg?
Using DELETE what type of file can you delete? a)SEQUENTIAL FILE B)INDEXED FILE C) D) Some options were there..i cant remember
what are the types of abends that occur on job failure? And explain the possible causes of these
Can you code instream data in a PROC ?
how to edit a tape dataset ? asked in wipro