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

JCL to set Return code when Time Out abend or Space Abend


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

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Wed May 30, 2018 11:27 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Wed May 30, 2018 12:15 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed May 30, 2018 12:30 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed May 30, 2018 12:56 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed May 30, 2018 1:02 pm
Reply with quote

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 icon_eyes.gif
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed May 30, 2018 8:03 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed May 30, 2018 9:41 pm
Reply with quote

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
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 ISAM and abend S03B JCL & VSAM 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top