BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

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?

4 REPLIES 4
alepage
Barite | Level 11
%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;

 

 

SASKiwi
PROC Star

You could also try the SAS option ERRORABEND which is good for batch jobs.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1157 views
  • 0 likes
  • 3 in conversation