View previous topic :: View next topic
|
Author |
Message |
Prashant Sharma
New User
Joined: 26 May 2008 Posts: 8 Location: india
|
|
|
|
I faced a problem with JCL COND parameter. Though, I resolved the problem, however need to confirm my understanding.
In the below suggested JCL.
JOBSTEP1 - runs with RC=04, which made JOBSTEP2 - as non-executable.
JOBSTEP3 is checking RC of JOBSTEP3 for GO-NO-GO.
So, what will happen with JOBSTEP3 ? Will it execute ? If yes, then what will be the RC value set by JOBSTEP2 ?
Code: |
//JOB CARD
//*
//JOBSTEP1 EXEC PGM=XYZ
//*
//JOBSTEP2 EXEC PGM=ABC,COND=(4,EQ)
//*
//JOBSTEP3 EXEC PGM=EFG,COND=(4,EQ,JOBSTEP2) |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
The third step will execute, The COND=(4,EQ,JOBSTEP2)
is the condition which will stop execution of the step and this condition is false, so the third step executes.
The jobstep2 gets flushed so I think there is no RC for that step.
hope it helps. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Tested
Code: |
//DUMYSTEP EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DATA,DLM='$$'
/*REXX*/
SAY 'HI'
EXIT 4
$$
//SYSUT2 DD DSN=&&TEMP(TESTIT),DISP=(NEW,PASS,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(1,1,20),RLSE),
// DCB=(BLKSIZE=6160,LRECL=80,RECFM=FB,DSORG=PS)
//*
//JOBSTEP1 EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSPROC DD DSN=&&TEMP(TESTIT),DISP=(OLD,DELETE,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
%TESTIT
/*
//JOBSTEP2 EXEC PGM=IEFBR14,COND=(4,EQ)
//JOBSTEP3 EXEC PGM=IEFBR14,COND=(4,EQ,JOBSTEP2) |
the JOBSTEP1 returns RC of 4.
Output:
Code: |
STEPNAME PROCSTEP RC EXCP
DUMYSTEP 00 43
JOBSTEP1 04 39
JOBSTEP2 FLUSH 0
JOBSTEP3 00 8 |
Hope it helps. |
|
Back to top |
|
|
Prashant Sharma
New User
Joined: 26 May 2008 Posts: 8 Location: india
|
|
|
|
Thanks Vasanthz.
However, I wanted to know, against which RC Value COND in JOBSTEP3 is comparing? Is there any default value, in this case which is Not Equal to '4' ?
Thanks. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It is comparing against the job step that YOU have specified in the JCL that it should check against
Time to read / re-read the manual I think |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
From chapter 16.5 of the JCL Language Reference manual (link at the top of the page):
Quote: |
The system performs the COND parameter tests against return codes from the current execution of the job. If a test specifies a previous step that was bypassed, the system evaluates the COND parameter as false. |
Since the job step for the JOBSTEP3 condition code test was flushed, there is no comparison done -- the COND is just set to FALSE, period. |
|
Back to top |
|
|
Prashant Sharma
New User
Joined: 26 May 2008 Posts: 8 Location: india
|
|
|
|
Thanks a lot Rob and Expat!!! |
|
Back to top |
|
|
|