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 |
I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?
What is the function of the steplib dd statement?
can u explain gdg with example wht happens if we give limit,empty,noempty,scartch and no scartch
which utility is used a dummy utility?
When output dataset space is required, what quantity categories are used?
hi iam learning mainframes,can anybody tell me how to check JCL errors.(after submiting the JCL we have check in spool or is there any other method)
In one of intervie, my interviwer asked, I have a file which contains 4 records I would like to split the 4 different outputs for each record how to do?
14 Answers Cap Gemini, Cognizant, JPMorgan Chase, TCS, Xansa,
wht is the d/f between positional parameter n keyword parameter ?
I have multiple jobs ( JCLs with several JOB cards ) in a member. What happens if I submit it?
What is the function of a dd statement?
What is the use of ikjeft1b utility in jcl?
how do you resolve for soc7 error