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

how to handle return codes


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1702
Location: Australia

PostPosted: Tue Sep 02, 2008 11:10 am
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
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: 2481
Location: @my desk

PostPosted: Tue Sep 02, 2008 11:39 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts AI writing DFSORT, REXX codes.. All Other Mainframe Topics 3
No new posts REXX GETMSG does not return £HASP880... CLIST & REXX 2
No new posts RXSUBCOM Return Codes / Documentation CLIST & REXX 6
Search our Forums:

Back to Top