View previous topic :: View next topic
|
Author |
Message |
Vivek Anand
New User
Joined: 04 Jun 2013 Posts: 19 Location: India
|
|
|
|
Hi,
I have a requirement to execute a step only if a certain previous step is not executed. I have used the below JCL for this
//REXXSUCC EXEC PGM=IKJEFT01
.
.
//CHECK IF NOT(REXXSUCC.RUN) THEN
//REXXFAIL EXEC PGM =IKJEFT01
.
.
// ENDIF
However, whenever the step 'REXXSUCC' gets flushed (not executed), the step 'REXXFAIL' also does not get executed. Any idea why this is happening? I am not sure how to check the result of the expression NOT(REXXSUCC.RUN) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The system distinguishes between "flushed" (as in a JCL error caused the job to not proceed and the step not to start execution) and "not executed" (as in the step did not meet the COND / IF requirements). You might be able to use ABEND in your IF statement to account for that condition (depending, of course, on why the step flushed -- a time out or operator cancel, for example, means that your REXXFAIL step will not execute under any circumstances). |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
please show the entire job output (including job card)
There must be another step before the REXXSUCC step, otherwise step REXXSUCC would execute.
I ran this and got correct results
Code: |
//STEP0001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=4
//CHECK01 IF (STEP0001.RUN)
// & (STEP0001.RC = 0) THEN
//REXXSUCC EXEC PGM=IEFBR14
// ENDIF
//CHECK IF NOT(REXXSUCC.RUN) THEN
//REXXFAIL EXEC PGM=IEFBR14
// ENDIF
|
although I prefer this
Code: |
//*
//STEP0001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=4
//*
//CHECK01 IF (STEP0001.RUN)
// & (STEP0001.RC = 0) THEN
//REXXSUCC EXEC PGM=IEFBR14
//CHECK01 ENDIF
//*
//CHECK02 IF (REXXSUCC.RUN = FALSE) THEN
//REXXFAIL EXEC PGM=IEFBR14
//CHECK02 ENDIF
//*
|
Gerry |
|
Back to top |
|
|
Vivek Anand
New User
Joined: 04 Jun 2013 Posts: 19 Location: India
|
|
|
|
Hi Robert/Gerry,
Thanks for your valuable suggestion. I now understand why the step REXXFAIL was not getting executed. The previous step was resulting in an abend (RC - S806) due to incorrect load module. As Robert suggested, it looks like the System chose not to execute any subsequent steps and hence REXXFAIL was also not getting executed.
Gerry,
As you suggested, i have now replaced the previous step with one that gives a return code like 8 or 16 and now REXXFAIL is getting executed. I shall replace the statement with 'REXXSUCC.RUN = FALSE'. |
|
Back to top |
|
|
|