MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SET RETURN Code

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Thu Aug 28, 2003 11:48 am    Post subject: SET RETURN Code Reply with quote

Hi ,

I need a small help with JCL coding.

How to set RC of a step to zero.

say step01.rc = 16

How to reset the RC of this step to zero in the jcl


Thanks,
Vijay
Back to top
View user's profile Send private message
prakal
Beginner


Joined: 14 Mar 2003
Posts: 22
Topics: 1

PostPosted: Thu Aug 28, 2003 1:07 pm    Post subject: Reply with quote

You could execute an IEFBR14 step to reset the return code for the entire job

Code:
 
//STEP02   EXEC PGM=IEFBR14


If you could let the forum know what you are trying to acheive by reseting the return code of a particular step to zero, we might be able to provide you with better suggestions.

Prakal
Back to top
View user's profile Send private message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Thu Aug 28, 2003 2:50 pm    Post subject: Reply with quote

STEP1 : RC IS EITHER 0 OR 16

STEP2,3 AND 4 :WILL RUN BASED ON RC FROM STEP1 (I USE COND=(0,NE) AND WORKS FINE)

STEP 5:
//DUMSTEP EXEC PGM=IEFBR14,COND=(0,NE)

STEP 6:
//SYSABEND EXEC PGM=ABEND,COND=((0,EQ,DUMSTEP)
ABEND PROGRAM IS NOT EXISTING SO YOU'LL GET 806 ABEND IF THIS STEP IS EXECUTED.


When step1 RC=16,I wan't the overall job to come with a zero code.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Thu Aug 28, 2003 4:46 pm    Post subject: Reply with quote

It is not that easy to retrospectively change a steps condition code. It would require a program to manipulate internal control blocks. What is the reason that you want the overall RC of 0, my guess is that it is perhaps for scheduling purposes in which case most of the major schedulers that I am aware of will allow a cond code of 16 to be acceptable, some schedulers also allow a distinction between the highest and last issued condition code.

Another way would be write what I'll term as a wrapper program to invoke the real program (could be done in virtually any language). This program simply calls the program you want and then sets the condition code to what you want depending upon the condition code returned from the invoked program. To be able to bypass subsequent steps the step would have to issue a non zero condition code. You could possibly even expand this method to reduce the number of steps, not that I believe this to be desirable.

Yet another way could be for the job that you want to issue the return code to submit a satellite job that invokes the program issuing the retrun code 16, perhaps with a step that either doesn't or does write a record to a dataset depending upon the condition code. The main job could then check this dataset (you'd have a problem knowing when the second job ran, but a Rexx/Clist program could detect this) to see if it has any data.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Fri Aug 29, 2003 9:43 am    Post subject: Reply with quote

Mike,
Can we use (dummy) IDCAMS in this situation to set the return code to 0 ?

//STEPXX EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET MAXCC=0
//*
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Aug 29, 2003 11:31 am    Post subject: Reply with quote

Suresh,
The method you have shown above will only set the maxcc of that particular step to 0 but not to the entire job.As mike stated earlier , you need to manipulate the internal control blocks.If any of the steps issues a 16 which being the highest rc issued , then the job ends with that return code even if the last step issues a zero return code.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group