Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Checking for return codes from multiple steps

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
venkatachalam

New User


Joined: 23 Sep 2006
Posts: 1
Location: Chennai

PostPosted: Sat Sep 23, 2006 11:45 am    Post subject: Checking for return codes from multiple steps
Reply with quote

Hi,
I want to execute a step in JCL depending on the return codes of previous steps using COND parameter and not using IF THEN clause.

Eg : Lets say there are 4 steps viz., STEP1, STEP2, STEP3 and STEP4.
//STEP1 EXEC PGM = PGM1
:
:
//STEP2 EXEC PGM = PGM2
:
:
//STEP3 EXEC PGM = PGM3
:
:
//STEP4 EXEC PGM = PGM4

Now I want to execute STEP4 if the return code of all the previous 3 steps is zero. Assume we are not checking for the return codes for the STEP2 and 3. By using IF clause, we can accomplish this by having the following piece of code :

// IF STEP1.RC = 0 AND STEP2.RC = 0 AND STEP3.RC = 0 THEN
// STEP4 EXEC PGM = PGM4

But i want it to be accomplished using COND parameter. Is there a way out for this? Do tell me how to use the conditional parameters (AND , OR) with COND parameter.
Back to top
View user's profile Send private message

chandru_g

New User


Joined: 07 Mar 2006
Posts: 5

PostPosted: Sat Sep 23, 2006 9:47 pm    Post subject: Re: Checking for return codes from multiple steps
Reply with quote

I guess this should work....

// STEP4 EXEC PGM = PGM4, COND=((0,LT,STEP1),(0,LT,STEP2),(0,LT,STEP3))

This will check if '0 is lesser than the return codes of Step 1,2 and 3'

If any of the steps 1,2 or 3 errors out, then the return codes will be >=4, in this case Step4 shouldn't execute.... so 0 LT return_code(step) comes true n the step4 is bypassed.

If all the steps are executed successfully then condition '0 LT 0' is false so the step4 is executed.

Correct me if I am wrong!
Back to top
View user's profile Send private message
rajyalalitha

New User


Joined: 25 Sep 2006
Posts: 6
Location: bangalore

PostPosted: Tue Sep 26, 2006 2:21 pm    Post subject:
Reply with quote

u r correct
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Reasonable way of checking wildcards ... sergeyken CLIST & REXX 5 Wed Sep 07, 2016 8:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us