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
 

 

how to handle return codes

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

New User


Joined: 23 Jul 2008
Posts: 27
Location: City of Joy

PostPosted: Tue Sep 02, 2008 10:49 am    Post subject: how to handle return codes
Reply with quote

I've written a proc to check whether an extract file contains any records or is empty. I also have written the jcl for it but I have to handle the return code in the jcl which i have no clue whatsoever .... for example
if RC = 1
exec pgm1
else
exec pgm2
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Sep 02, 2008 11:10 am    Post subject:
Reply with quote

Hi,

here is a way to achieve it
Code:
//STEP0001  EXEC PGM=IDCAMS                                   
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SET MAXCC=1                                                 
/*                                                           
//CHECK01  IF (STEP0001.RC = 0) THEN                         
//*                                                           
//SELECT1   EXEC PGM=PGM01                                   
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SET MAXCC=0                                                 
/*                                                           
//         ELSE                                               
//SELECT2   EXEC PGM=PGM02                                   
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SET MAXCC=0                                                 
/*                                                           



Gerry
Back to top
View user's profile Send private message
Sudhanshu Shekhar

New User


Joined: 23 Jul 2008
Posts: 27
Location: City of Joy

PostPosted: Tue Sep 02, 2008 11:35 am    Post subject: Reply to: how to handle return codes ina jcl
Reply with quote

Gerry,
Thanks a ton.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Sep 02, 2008 11:39 am    Post subject:
Reply with quote

Alternately, you can use COND parameter like this.

Code:
//STEP1  EXEC PGM=IDCAMS                                   
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SET MAXCC=1                                                 
/*                                                           
//STEP2   EXEC PGM=PGM1,COND=(1,NE,STEP1)
..........
..........
//STEP3   EXEC PGM=PGM2,COND=(1,EQ,STEP1)
..........
..........


Thanks,
Arun
Back to top
View user's profile Send private message
Sudhanshu Shekhar

New User


Joined: 23 Jul 2008
Posts: 27
Location: City of Joy

PostPosted: Tue Sep 02, 2008 11:47 am    Post subject:
Reply with quote

Arun,

i have been using the COND parameter to check for the proper execution of the step, but never used it for multiple steps .

Thanks a lot.
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
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts EZASOCKET Return code 32509 amitc23 All Other Mainframe Topics 4 Mon May 23, 2016 4:13 pm
No new posts How to handle AISS abend ? robin ma 2015 CICS 1 Mon Nov 09, 2015 1:47 pm


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