Page 2 of 2

Re: JCL IF to override //STEPLIB in a Proc

PostPosted: Tue Mar 05, 2013 10:56 pm
by 20sam13
And how does the example provided resolve the question I had to override a //STEPLIB by using a condition if?

As it stands right now, our system already uses an INCLUDE MEMBER=RPSLIB statement.

My goal was to use an If-Then-Else construct to set the steplib based upon 1 single change to a set statement in the JCL. Based upon that set statement value, the JCL would override the corresponding PROCLIB step with the preferred //STEPLIB.

So, if I were to:

// SET PROD=YES

//IF (PROD=YES) THEN
//procstep.STEPLIB DD "use the PROD LOAD LIB concatenated list".
//ELSE
//procstep.STEPLIB DD "use the TEST LOAD LIB concatenated list".
//ENDIF

Is there a way to use a SET LIB= to a "concatenated list" of loadlibs?

Re: JCL IF to override //STEPLIB in a Proc

PostPosted: Tue Mar 05, 2013 11:21 pm
by enrico-sorichetti
And how does the example provided resolve the question I had to override a //STEPLIB by using a condition if?

You were so busy criticizing that You just did not notice that the include was parametrized according to the set statement

//IF (PROD=YES) THEN

what is that is not clear when the manual tells that the construct and the logic You are trying to use is not valid :evil:

Re: JCL IF to override //STEPLIB in a Proc

PostPosted: Tue Mar 05, 2013 11:39 pm
by Robert Sample
// SET PROD=YES

//IF (PROD=YES) THEN
//procstep.STEPLIB DD "use the PROD LOAD LIB concatenated list".
//ELSE
//procstep.STEPLIB DD "use the TEST LOAD LIB concatenated list".
//ENDIF
This is not valid JCL and no matter how many times you post, it will not magically become valid JCL. The IF statement in JCL is, per the manual, allowed to be
IF RC
IF ABEND
IF ¬ABEND
IF ABENDCC
IF RUN
IF ¬RUN
and parentheses can precede the keyword. Using other keywords, including IF PROD or IF &PROD or anything else is not valid even if the system does not flag it as an error.

Re: JCL IF to override //STEPLIB in a Proc

PostPosted: Wed Mar 06, 2013 9:31 am
by NicC
// SET ENV=P
//...
//* include steplib for environment...
// INCLUDE STEPLIB&ENV
//....


May not be correct JCL but have no manual to hand at the moment but the concept is correct. You have an include member for each of your production and test environments. You select which to use by use of the SET statement. I know that this works because I unified diverse test/production procedures into just one procedure with a lot of different INCLUDEs. The hard part is just setting it up in the first place. Then you just need 2 job decks - one for production which will 'never' change and one for test.