%macro bort(Condition);
%put Random debug print;
%if &Condition = stop_value %then %return;
%put After return;
%mend;
%bort(no_stop);
%put
%bort(stop_value);
hello here is my code %bort how do i make more flexible & generic to abort condionally a sas prg. can i use data_null_ plz give logic/code to enhamce my code. thanks in advance....
Do you know about the ERRORABEND option? That will abort a SAS program when an error is encountered.
You may also want to check out the ERRORCHECK and SYNTAXCHECK options and error handling in general:
It's funny that you ask if you can do something - didn't occured to you that you could test it yourself first?
You might want to check documentation for the %sysrc macro that returns values related to error conditons.
Also the system automatic macro variable SYSERR which is set at each step boundary (data step or procedure call)
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.
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.