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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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