View previous topic :: View next topic
|
Author |
Message |
Raymond Sachs
New User
Joined: 13 Dec 2007 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Raymond Sachs
New User
Joined: 13 Dec 2007 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Raymond Sachs
New User
Joined: 13 Dec 2007 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|