Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using if/then/else with return code
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Jan 07, 2011 3:59 am    Post subject: Reply to: using if/then/else with return code
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

Site Director


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

PostPosted: Fri Jan 07, 2011 4:11 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jan 07, 2011 10:25 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Force a Return Code and print error m... Rick Ryan SYNCSORT 25 Thu Jun 25, 2020 1:18 am
No new posts trying to set return code in PROC tanvi110788 JCL & VSAM 16 Wed May 20, 2020 2:02 pm
No new posts Need help in REXX code to list the af... chavinash2004 CLIST & REXX 3 Wed Apr 01, 2020 12:53 pm
No new posts Error Creating KSDS file, REASON CODE... sandeep prajapati JCL & VSAM 8 Tue Mar 24, 2020 12:05 pm
No new posts Indent cobol code Renato Zangerolami COBOL Programming 6 Thu Feb 13, 2020 12:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us