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

Stoping JOB steps based on Return Code.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rpchandar

New User


Joined: 02 Sep 2005
Posts: 6

PostPosted: Thu Oct 20, 2005 11:23 am
Reply with quote

Hi,

I have a JCL, which has 15 Steps. Based on the return Code of step 5, I want to execute the remaining steps. If the the return code of step-5 is greater than 8, the remaining steps should not execute and the job should end. One way is to check for condition code from step 6 to step 15. Is there any other way?
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Oct 20, 2005 2:05 pm
Reply with quote

This question is already discussed, make a search before posting.

Yes, of course but you must be sure that the same return code does not appair in the previous steps.
If you code your jobcard with COND=(8,EQ) your job will end if this condition is satisfied but only the first time.
This is a sample:
Code:
//$MYJOB   JOB 'accn',CLASS=X,COND=(8,EQ)
//STEP010I EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=B     
//SYSIN    DD *           
   SET MAXCC=1               
//STEP020I EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=B     
//SYSIN    DD *           
   SET MAXCC=8               
//STEP030I EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=B     
//SYSIN    DD *           
   SET MAXCC=1               

and, in this case, the job is stopped after the STEP020I.

I hope in this help.
Back to top
View user's profile Send private message
rpchandar

New User


Joined: 02 Sep 2005
Posts: 6

PostPosted: Thu Oct 20, 2005 2:14 pm
Reply with quote

Thanks for your help.

Regards,
Phani
Back to top
View user's profile Send private message
keler

New User


Joined: 20 Oct 2005
Posts: 1

PostPosted: Thu Oct 20, 2005 3:32 pm
Reply with quote

If not sure the return code of previous steps is whether equal to 8 , you can add COND=(8,EQ,step5) to your jobcard from step 6 to step 15.
This is a example:
Code:
//STEP6   EXEC PGM=***,COND=(8,EQ,STEP5)
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD *                         
//STEP7   EXEC PGM=***,COND=(8,EQ,STEP5)
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD *                         
  ....                                 
//STEP15  EXEC PGM=***,COND=(8,EQ,STEP5)
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD *                         


Hope it useful
Regards
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Fri Oct 21, 2005 12:56 am
Reply with quote

check the JCL manual for usage of IF ENDIF statements.



Dave
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts CA7 deleting files in steps after job... CA Products 4
Search our Forums:

Back to Top