JCL PROC:OVERRIDE IF-ENDIF



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL PROC:OVERRIDE IF-ENDIF

Postby raghav08 » Mon Mar 21, 2011 2:11 pm

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.
raghav08
 
Posts: 18
Joined: Wed Oct 27, 2010 5:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL PROC:OVERRIDE IF-ENDIF

Postby prino » Mon Mar 21, 2011 2:40 pm

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.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: JCL PROC:OVERRIDE IF-ENDIF

Postby NicC » Mon Mar 21, 2011 4:59 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post