BookmarkSubscribeRSS Feed
SAS_inquisitive
Lapis Lazuli | Level 10

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.

 

http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0hp2evpgqvfsfn...

3 REPLIES 3
Reeza
Super User

@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. 

Kurt_Bremser
Super User

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

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 848 views
  • 0 likes
  • 4 in conversation