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

Accessing ABENDCC in JCL


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

New User


Joined: 09 May 2016
Posts: 30
Location: India

PostPosted: Mon Aug 01, 2022 11:26 pm
Reply with quote

Hi,

I am trying to handle a user failure code (via ABENDCC) in a scheduled job - the failure code is being assigned by scheduler I guess (something like U0XX).

Now when I try to test same code in with my id, the user code (U0XX) is not reported but just RC12 on file copy step (IEBGENER - copying file with different record length).

Is there any way within JCL - just for testing - to know ABENDCC of last step. I can not just use RC12 as it is too generic.

Apologies if the query is strange and Thanks in anticipation.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 387
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Tue Aug 02, 2022 1:23 am
Reply with quote

What about solving the different length problem first?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1617

PostPosted: Tue Aug 02, 2022 3:54 am
Reply with quote

Search in Google (or RTFM):

“JCL IF statement”
Back to top
View user's profile Send private message
Nileshkul

New User


Joined: 09 May 2016
Posts: 30
Location: India

PostPosted: Tue Aug 02, 2022 8:12 pm
Reply with quote

Thanks for replies.

Just to clarify - I am not getting U0** error code in testing since it seems assigned by scheduler when it run by scheduler and if I test job with my own id, it just returns just RC12. So I need to know what is ABENDCC in this specific case. So Is there any way to know ABENDCC of step executed in JCL. I agree IF/THEN statements would help but that is after the ABENDCC is known to handle it like 'IF STEP30.ABENDCC = U0** THEN'

Please help on this, Thanks in anticipation.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1617

PostPosted: Tue Aug 02, 2022 11:07 pm
Reply with quote

In any case, you would not be able to handle hundreds, or thousands of possible ABEND codes automatically, within the same job.

If you are able to handle 1-3-5 of them, you can check for these specific ones in the // IF (step.ABENDCC= ??) statement(s), and then call your ABEND handler.

For all other ABENDs you can either use a general step with // IF (step.ABEND), or just leave it as is, to be analyzed manually as unexpected program behavior.

My opinion: your goal doesn't worth the required efforts.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 629
Location: Denmark

PostPosted: Wed Aug 03, 2022 1:58 pm
Reply with quote

Not JCL, but you can use the REXX API to scan output from the current job and extract the abend/return codes that way.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 911
Location: Bamberg, Germany

PostPosted: Wed Aug 03, 2022 2:06 pm
Reply with quote

You can also access the Job info until to the point where some REXX is run. AFAIKT it does not yet take care for User and System ABENDs, but such things exist.
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 Accessing control blocks to retrieve ... COBOL Programming 5
No new posts VSAM - Accessing beyond record size JCL & VSAM 6
No new posts Accessing CICS tran with map from JCL... CICS 5
No new posts Accessing first bit of PD value DFSORT/ICETOOL 11
No new posts Access SQLCA fields inside a stored p... DB2 6
Search our Forums:

Back to Top