DATA Step, Macro, Functions and more

"abort abend 0" with unexpected result

Reply
Contributor
Posts: 51

"abort abend 0" with unexpected result

Dear all,

according to the SAS documentation I understand that the code

%macro test;
%abort abend 0;
%mend test;
%test;

should deliver a return code of 0 to the OS.

However, what I get is a 5 - ERRORABEND is set to NOERRORABEND.

What else could be the the reason that the above listed code does NOT return a 0?

Thanks a lot and regards,
Thomas
Super Contributor
Super Contributor
Posts: 3,174

Re: "abort abend 0" with unexpected result

Please share more info, specifically what OS, what SAS version, and explain more about how your SAS application is being executed? Also, consider there are differences between the macro language %ABORT and the DATA step ABORT statement. As well, it would be useful to review the SAS Companion document for your particular OS environment.

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 51

Re: "abort abend 0" with unexpected result

Hi Scott,

SAS Version would be 9.13, OS is AIX and the application is - simplified - nothing more than the above described macro.

I cannot find any more information in the SAS companion than a description on what %abort does and - if not as expected - I should check ERRORABEND, which I did.

Thanks,
Thomas
Super Contributor
Super Contributor
Posts: 3,174

Re: "abort abend 0" with unexpected result

Suggest you open a SAS support track to report the condition.

Scott Barry
SBBWorks, Inc.


http://support.sas.com/techsup/contact/submit_emits2.html
Super Contributor
Posts: 474

Re: "abort abend 0" with unexpected result

Hello Thomas.

There is nothing wrong with what you reported.

Actually, SAS Condition Code (ABEND's n) are not System Return Codes, and so, not returned to the system as they are.

For the following scenarios expect the following RCs:

0 Normal completion
1 SAS issued warning(s)
2 SAS issued error(s)
3 ABORT;
4 ABORT RETURN n;
5 ABORT ABEND n;
6 Internal error

So as you see, the reported behavior is perfectly right (ABORT ABEND n => RC=5)

Check the online documentation:
http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/a000397268.htm

You may want to consider the ENDSAS; statement to end your SAS script at any moment, without returning an ERROR RC to the system.

Check here:
http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000289392.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt.
Ask a Question
Discussion stats
  • 4 replies
  • 309 views
  • 0 likes
  • 3 in conversation