BookmarkSubscribeRSS Feed
ThomasH
Calcite | Level 5
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
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
ThomasH
Calcite | Level 5
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
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you open a SAS support track to report the condition.

Scott Barry
SBBWorks, Inc.


http://support.sas.com/techsup/contact/submit_emits2.html
DanielSantos
Barite | Level 11
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1234 views
  • 0 likes
  • 3 in conversation