Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2287
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 IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts EXIT or RETURN cvnlynn CLIST & REXX 18 Wed Jul 19, 2017 2:50 am
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm

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