02-12-2016 04:59 PM
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.
02-12-2016 08:31 PM
@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.
02-15-2016 07:56 AM
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.
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