Page 1 of 1

JCL PROC:OVERRIDE IF-ENDIF

PostPosted: Mon Mar 21, 2011 2:11 pm
by raghav08
Hello,

Please let me know how to ovrride a 'IF' statment which declared in a jcl proc.

EX:

JCL-Procudeure.

//XXXXX PROC
:
//STATCHK IF (STEPN100.BATCHIN.RC = 0 | STEPN120.RC = 2) THEN
:
// ENDIF

Now, how can we override the IF statement from a JCL

Thanks.

Re: JCL PROC:OVERRIDE IF-ENDIF

PostPosted: Mon Mar 21, 2011 2:40 pm
by prino
raghav08 wrote:Hello,

Please let me know how to ovrride a 'IF' statment which declared in a jcl proc.

EX:

JCL-Procudeure.
//XXXXX PROC
:
//STATCHK IF (STEPN100.BATCHIN.RC = 0 | STEPN120.RC = 2) THEN
:
//        ENDIF

Now, how can we override the IF statement from a JCL.


In the above it's impossible, but if you really want to override IF-THEN-ELSE logic in PROCs, you can do so, in a generalized, but somewhat convoluted way, by adding a parametrized dummy condition, like

//XXXXXXX PROC OVERIF='RC >= 0 | RC < 0'
:
//STATCHK IF (STEPN100.BATCHIN.RC = 0 | STEPN120.RC = 2)  & &OVERIF THEN
:
//        ENDIF


The "'RC >= 0'," is always true, so it has no influence on original, and likewise for the "RC < 0'", which is always false. Obviously, the above code assumes that the entire original conditional expression is enclosed in parentheses, and that there is an RC to test against!

Change OVERIF into 'RC <= 0' to stop execution of the step, change it into ' RC >= 0 | RC >= 0' to always execute it.

Re: JCL PROC:OVERRIDE IF-ENDIF

PostPosted: Mon Mar 21, 2011 4:59 pm
by NicC
The other thing to do is to write your JCL so that such a requirement is not needed. I.E if you nee to run just one step within and IF-ENDIF then make sure ALL the steps within the group can run with no adverse affect.