IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

using if/then/else with return code


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jan 07, 2011 3:59 am
Reply with quote

FWIW, here's an undocumented method to execute or not execute steps in a JOB. I use this in many disaster recovery JOB's, which have many steps which I may want to execute or not execute.

Using 1's and 0's is akin to boolean logic (1=ON, 0=OFF).

Code:

// SET RUNSTP1=1
// SET RUNSTP2=0
//*
// IF  &RUNSTP1=1 THEN
//* THE STEP WILL RUN, VARIABLE RUNSTP1 RESOLVES TO A 1
// ENDIF
//*
// IF &RUNSTP2=1 THEN
//* THE STEP WILL NOT RUN, VARIABLE RUNSTP2 RESOLVES TO A 0
// ENDIF
//*
//

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 07, 2011 4:11 am
Reply with quote

Hello,

Quote:
The fact that I cannot do this the way that I should be able to do it is very clear to me now.
Why do you believe you "should be able" icon_confused.gif

If you should be able, IBM would have implemented same.

It is quite important to test an approach before commiting to it and then needing to back-up and re-group.
Back to top
View user's profile Send private message
Alex Garcia

New User


Joined: 06 Jan 2011
Posts: 9
Location: Kansas City

PostPosted: Fri Jan 07, 2011 9:49 pm
Reply with quote

dick scherrer wrote:
Hello,

If you should be able, IBM would have implemented same.



So if IBM hasn't implemented it, then it shouldn't be done?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 07, 2011 10:25 pm
Reply with quote

Hello,

Not until you (or a large group) convince IBM to change "the way it works" icon_smile.gif

Actually, "should" has little to do with it - as of the current implementation, you cannot do what you want the way you want to do it. . .

Many (most?) of us have been frustrated by the way some things are. Usually, they are not going to change (especially not quickly enough to be used for anything currently being worked on).
Back to top
View user's profile Send private message
parsesource

New User


Joined: 06 Feb 2006
Posts: 97

PostPosted: Sun Jan 09, 2011 10:05 pm
Reply with quote

Robert Sample wrote:
Unless you explicitly name each step of the proc by using the appropriate two-level identifier, what you want to to cannot be done. You might want to investigate using your site's job scheduler to schedule three separate jobs, in which case the only condition codes to matter will be the ones in the current job.


it can be done the following way. you have to add the stepname as parameter to the proc.


Code:

//A JOB
//STEP1 EXEC FOO,STEPNAME=STEP1
//STEP2 EXEC FOO,STEPNAME=STEP2
//STEP3 EXEC FOO,STEPNAME=STEP3
//


and FOO looks like
Code:

//FOO PROC
//PRCSTEP1 EXEC PGM=BAR
// IF (&STEPNAME.PRCSTEP1.RC=0) THEN
//PRCSTEP2 EXEC PGM=SUMMAT
// ENDIF
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top