Generate Abend with user defined abend code and reason



High Level Assembler(HLASM) for MVS & VM & VSE

Generate Abend with user defined abend code and reason

Postby xboss » Thu Feb 23, 2012 10:54 am

Hi,
I am trying to purposely abend my program with completion code X'AAA' and reason code X'123'. I know I can abend my program with ABEND macro as below. Sorry for my limited knowledge on assembly and mvs, I thought whatever I load on Register 15 will come as reason code.
LA R2,REASON
LR R15,R2
ABEND X'AAA'
***DATA *****
REASON DC X'123'

Now my program is abending with
ABEND=S000 U2730 REASON=00000000

But I did not see the result I expected. I want to have reason code equivalent to X'123'. Any guidance would be greatly appreciated.

Thanks.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Generate Abend with user defined abend code and reason

 

Re: Generate Abend with user defined abend code and reason

Postby enrico-sorichetti » Thu Feb 23, 2012 11:17 am

... I thought whatever I load on Register 15 will come as reason code.


if instead of thinking You had looked at the manual,
the chances of getting the right results would have been higher...
http://publibz.boulder.ibm.com/cgi-bin/ ... 0522045539
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Generate Abend with user defined abend code and reason

Postby steve-myers » Thu Feb 23, 2012 11:20 am

The ABEND macro is fully documented in "MVS Assembler Services Reference" for your z/OS release.

The ABEND macro you show is for a user ABEND X'AAA'. The system effectively converted the X'AAA' to decimal and correctly reported the ABEND code. All user ABENDs are reported as decimal digits; there is no such animal as a user ABEND with hex digits. This is reserved for system ABENDs. Similarly, there is no such animal as a system ABEND being reported as decimal digits. While it is possible to convert your ABEND macro to be a "system" ABEND, I would discourage such foolishness; it could send the users of your program to a fruitless or erroneous search of MVS documentation for an SAAA ABEND code.

Your method to specify a reason code is also incorrect. Read the manual carefully.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Generate Abend with user defined abend code and reason

Postby steve-myers » Thu Feb 23, 2012 11:31 am

One more comment. Reason codes are reported as decimal digits, not hexadecimal digits. It is rare that user ABENDs use reason codes, but you're welcome to try it.

You are correct that register 15 contains the reason code, but the ABEND macro must put it there.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Generate Abend with user defined abend code and reason

Postby xboss » Thu Feb 23, 2012 11:40 am

Enrico,
The link below did it. Thank you so much for the link.
http://publibz.boulder.ibm.com/cgi-bin/ ... 5539&CASE=

Steve,
You rock man. Your explanation is highly appreciated.

And the problem is now solved. I am able to generate both User abend and reason code. :D

Thank you guys.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post