I was trying to understand the different arguments the ABORT statment. One of many arguments is interger(n). What is the purpose of that number. An example would be helpful to understand.
@SAS_inquisitive What does the documentation say about n? And what part is unclear to you. It's worth knowing as the documentation should be accessible and easy to navigate. If it's not, that an issue.
Quite simple. The <n> argument determines the exit condition that is handed back to the operating system once the SAS process has terminated.
This allows specific failure conditions that you detected during processing being treated correctly by the invoking shell script/batch file/scheduler/whatever.
eg
In some cases, we want to specifically detect if a certain table has a given minimum of records, and if not, signal that by passing 4 as the exit code:
data somelib.someset;
infile our_in end=done;
* input statements;
if done and _n_ < &minimum_rec then abort abend 4;
run;
Now the envoking script (after detecting that SAS exited with code 4) can set a special condition that lets the scheduling software trigger another job that sends an alarm email with the detailed information that not enough data was provided
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.