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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 840 views
  • 0 likes
  • 4 in conversation