Hello,
I am using a unix command such as nohup sas maindriver.sas &
which call many sas macro functions , one at the time...
I would like to add a unix command into on of these sas macro functions to stop execution because I am trying to make some troubleshooting and I want the process stop, until I have found where the problem come from?
You mean that the program should stop itself when it detects a certain condition (e.g. &syscc ne 0)?
%macro mainfunc; %m1; %m2; %m3; %m4; %m5; %mend mainfunc; %mainfunc;
Suppose that my mainfunction call m1, m2 , m3, m4, m5
So imagine that in m3, for example, I need to make a libname statement and if the libname does not exist, how can I abort the %mainfunc;
Abort when an error state is detected:
%if &syscc. ne 0 %then %do;
%abort abend 2;
%end;
You could also try the SAS option ERRORABEND which is good for batch jobs.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: