DATA Step, Macro, Functions and more

Exit code during ABORT

Posts: 51

Exit code during ABORT

Hi all,

I am facing an issue here with the return code passed by a macro %abort. In a specific scenario I would like to return a code of "0" to the system environment, although an %abort was thrown.

However I get the following return codes for the following statements:

%abort -> 3
%abort 0 -> 3
%abort abend 0 -> 5

What do I have to do to get a "0" when using %abort?

Thanks and regards,
Super Contributor
Super Contributor
Posts: 3,174

Re: Exit code during ABORT

The behavior may vary depending on your OS and the ERRORABEND setting. Also, consider that you have not only a %ABORT statement but also the %RETURN statement to use. And there are optional parameters you can pass to influence the behavior.

A current SAS 9.2. doc link is listed below, but also check the SAS 'companion' for your OS and as well check your SAS version DOC for any behavior differences.

Scott Barry
SBBWorks, Inc.

SAS 9.2 MACRO Language %ABORT Statement
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation