JCL IF to override //STEPLIB in a Proc



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

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

Postby 20sam13 » Tue Mar 05, 2013 10:56 pm

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?
20sam13
 
Posts: 17
Joined: Fri Feb 15, 2013 8:44 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby enrico-sorichetti » Tue Mar 05, 2013 11:21 pm

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:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

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

Postby Robert Sample » Tue Mar 05, 2013 11:39 pm

// 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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

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

Postby NicC » Wed Mar 06, 2013 9:31 am

// 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.
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

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post