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
 

 

Force a Return Code on a JOB

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

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Wed Dec 01, 2010 5:08 am    Post subject: Force a Return Code on a JOB
Reply with quote

Dear Listers,

How can I force a Job to end with a return code (RC) = 06 after I
I detect a string "ABEND" in a dataset? Can this be done via JCL or
a sort. In COBOL, I can use RETURN-CODE to achieve that. I
would like to avoid coding a program from this. Any pointers?

Input:
Code:
****** ***************************** Top of Data *******************
000001 AAA 9293451 88.94  RAYMOND    SACHS     ABEND               
****** **************************** Bottom of Data *****************
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 01, 2010 9:02 am    Post subject:
Reply with quote

Hello,

Your alternatives will be quite limited if the return code must be 06.

Which sort product is used on your system?
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Wed Dec 01, 2010 1:44 pm    Post subject:
Reply with quote

We use SyncSort. I would not mind any other Return code except
for (04, 08, 12). This Return code will help me set conditional
execution in my next step.

So, if STEP030 has a RC= 06, then I would skip STEP040
and continue with STEP050.

On days where there is no presence of the literal "ABEND" in the
dataset, Step030 will get a RC = 0 and continue to process
STEP040 and then Step050.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Dec 01, 2010 1:47 pm    Post subject:
Reply with quote

Hi Dick,

His recent posts suggest that he has Syncsort. And Syncsort can generate RC4 or RC16, but if he's specific about an RC6 sort might not help.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Dec 01, 2010 1:54 pm    Post subject:
Reply with quote

I can not see the relevance of the RC from any step as this can be dealt with using COND= or IF/THEN/ELSE/ENDIF processing.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Dec 01, 2010 4:21 pm    Post subject:
Reply with quote

expat wrote:
I can not see the relevance of the RC from any step as this can be dealt with using COND= or IF/THEN/ELSE/ENDIF processing.

I read him as requiring a return code that is distinct from other likely return codes so that it may be identified as coming from the detection of the string "ABEND". I agree that identifying the step name in the COND parameter or the IF construct ought to handle the situation.

If nothing else but a unique value will do, the TS ought to consult with senpai in his shop; most sites have had for decades little COBOL or assembler programs that take a value as a run-time parameter or in a contol card, and feed it back as a return code or user abend.
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Wed Dec 01, 2010 11:01 pm    Post subject:
Reply with quote

Listers,
I am open to any suggestions if we can not use the RC
Quote:
can not see the relevance of the RC from any step as this can be dealt with using COND= or IF/THEN/ELSE/ENDIF processing.


How can I achieve that? I need to look at the literal 'ABEND' in a dataset
which will not be present everyday. So there has to be a mechanism that
will trigger the presence of 'ABEND'.
I can code a COND=(XX,EQ,STEP0030) on the step that i am willing to bypass only after the previous step
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Dec 01, 2010 11:36 pm    Post subject:
Reply with quote

How large will the data set be? If it is small, a little piece of Rexx might be an option. Otherwise, I believe that you can set the return code in DFSORT and Syncsort based on the presence of a string in a record, although as usual I will defer to Messrs. Yaeger and Kolusu, and to Ms. Margulies, as to the exact capabilities and limitations of those utilities.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 02, 2010 12:10 am    Post subject:
Reply with quote

If SAS® 9.2 Companion for z/OS® is installed you could use :

ABORT RETURN <n>;

where <n> is the return code.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Dec 02, 2010 12:45 am    Post subject:
Reply with quote

Hello,

See if something like this will do what you want:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DUMMY
//SYSIN DD *
  OPTION COPY,NULLOUT=RC4
  INCLUDE COND=(1,80,SS,EQ,C'ABEND')


Read about NULLOUT in the documentation.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Dec 02, 2010 10:28 am    Post subject:
Reply with quote

May be an OMIT COND can be used instead if you want RC=4 if 'ABEND' is found and RC=0 when 'ABEND' is not found.
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 PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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