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

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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 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: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 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: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 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

Re: Generate Abend with user defined abend code and reason

Postby RazVorox » Mon Feb 19, 2024 6:41 pm

14 YEAR FLASHBACK..

I revive this thread, coz its EXACTLY my question too.
Since i can't know what i don't know,
and since the link doesn't work (either for me - local sys blocking,
or in general - old and 404), I was wondering -

What book/document did it lead to?

just give me a title, and I'll take it from there...

Thnx,
Me.
RazVorox
 
Posts: 16
Joined: Wed Oct 19, 2022 11:52 am
Has thanked: 7 times
Been thanked: 1 time

Re: Generate Abend with user defined abend code and reason

Postby sergeyken » Mon Feb 19, 2024 8:22 pm

RazVorox wrote:14 YEAR FLASHBACK..

I revive this thread, coz its EXACTLY my question too.
Since i can't know what i don't know,
and since the link doesn't work (either for me - local sys blocking,
or in general - old and 404), I was wondering -

What book/document did it lead to?

just give me a title, and I'll take it from there...

Thnx,
Me.


1. (2024 - 2012) = 12, not 14

2. Learn about Google Search for “IBM ABEND Macro”

3. Click here ABEND Macro
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Generate Abend with user defined abend code and reason

Postby RazVorox » Tue Feb 20, 2024 1:14 pm

1 - thank you.
2 - I can google.
If you'd go there, you'd see its an older, Spanish version,
which I also found.
3 - since I don't know what the link is,
since it doesn't work,
and since I can not know that which I do not know, meaning - what's in the link,
I would go for -

4 - The link originally linked to - "z/Os MVS Programming: Assembler Services Reference, Volume 1 (ABE-HSP)"

5 - thanks.
6 - Srsly, Whats with the attitude on this site..
you guys really know how to make ppl feel unwelcomed.

7 - yes. true. 2024-2012 is indeed 12. not 14. my bad.
RazVorox
 
Posts: 16
Joined: Wed Oct 19, 2022 11:52 am
Has thanked: 7 times
Been thanked: 1 time

Re: Generate Abend with user defined abend code and reason

Postby enrico-sorichetti » Tue Feb 20, 2024 3:33 pm

and since the link doesn't work (either for me - local sys blocking,
or in general - old and 404)


the link worked 12 years ago...
do you really expect a link to be still active after 12 years ????
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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Generate Abend with user defined abend code and reason

Postby RazVorox » Tue Feb 20, 2024 4:14 pm

This is not about the link.
Also - i don't know.
That's why i asked.
Some, by the way - still work.

Point is - telling someone to LMGTFY, is.. pointless.
a pointless reply, that does nothing except push ppl away,
and portrait you as.. condescending.

Maybe its my generation, maybe we're just more sensitive,
But (unlike other times) - we have options.
like.. training our own LLM on base documentation.
(Or better even - there is already a site that did that.)
or use live code versions on GPTs style etc.

If I come here looking for answers, it's out of respect and
appreciation for elder-knowledge. for ppl who lived it, loved it,
and have the know-how and experience.

Thats what I'm looking for.
that extra teachings, extra.. something.
The manual? - I can read for myself.
also google.

But I really don't have to.
surely not with that attitude.
Which seems to be a generative reoccurring pattern of sorts
on this site.
so.. yeah. that.

Same way you assume the person didn't google,
you could choose assume he did.
Same way you assume he's.. (lazy? young? - pick your favorite
description) - you could assume that he's a 40+ adult,
that has appreciation for experience.

You guys always say to be clear on what you ask,
and to reply to the question asked, so..

I was clear.
I asked.
I got a LMGTFY + the guy didn't even bother
to paste the new version, and change the 'es' to 'en'.
so.. yeah.

anyways,
NM.
this is pointless.

My apologies,
My thanks,
and a good-day to you Sirs.

These users thanked the author RazVorox for the post:
jsmith33 (Wed Feb 28, 2024 6:55 pm)
RazVorox
 
Posts: 16
Joined: Wed Oct 19, 2022 11:52 am
Has thanked: 7 times
Been thanked: 1 time

Next

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post