View previous topic :: View next topic
|
Author |
Message |
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi All,
Is it possible to set return code when Time out abend (S322) or Space abend happens.
I would like to control the subsequent step based on this Return code, if previous step abends with Time Out or Space abend.
Thanks
Vinu |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
It is probably not possible to convert an Sx22 ABEND to a return code. Nor is it desirable. These ABENDs imply job termination.
However, it is theoretically possible for a program to transform an Sx37 ABEND to a return code.
OS/360 architects decided an ABEND solution for an inability to perform a function rather than using a return code a program is unlikely to check, and even if checked, would the program do the "right" thing? I've thought about this for a long time and never reached a conclusion. vinu78 seems to think a *nix type environment (and environments influenced by *nix ,like Windoze) are preferable.
OS/360 represents an environment where much work runs in a way the initiator of the work is not around to influence the response to a problem (batch, in other words) as opposed to *nix, which denies the idea of batch operation. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I know that you can use IF/THEN/ELSE for conditional processing based on ABEND, but AFAIK cannot specify a particular ABEND code |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
You can test for a specific abend, like // IF ABENDCC=S322 THEN
Of course the TIME parameter must be on a step, otherwise the step to handle the abend also gets a S322. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Hmmmmmmmmmmmmmmm
If the ABEND is S322 where do we get the extra time from to complete the job if the OS kills the job off |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
You can only trap for TIME set for step, the job time limit must of course be big enough for the remaining steps.
Sample:
Code: |
//GO EXEC RXINSTRM,TIME=(,1)
//REXX DD *
/* REXX */
A=0
DO 5000000
A=A+1
END
// IF ABENDCC=S322 THEN
//T1 EXEC RXINSTRM
//REXX DD *
/* REXX */
SAY 'ABEND S322 DETECTED'
// ELSE
//T2 EXEC RXINSTRM
//REXX DD *
/* REXX */
SAY 'ABEND S322 NOT DETECTED'
// ENDIF
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Quote: |
Is it possible to set return code when Time out abend (S322) or Space abend happens.
I would like to control the subsequent step based on this Return code, if previous step abends with Time Out or Space abend.
|
Or why don't you put subsequent steps in another job and make that as successor to the current job ( Do only if that's a feasible option) ? In any case if current job abend because of any reason ( or time out in your case) then you can f/c it and the other job gets trigger and then you don't have to do anything. |
|
Back to top |
|
|
|