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
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)
Joined: 06 Jun 2008 Posts: 8212 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).
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.
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'.