BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ps8813
Fluorite | Level 6

Hi,

 

Couldn't find the difference between ERRORABEND , ENDSAS ,ABORT.

 

What i understand is ,all terminate the SAS session if encounter error. But what is the difference and when to use which statement.

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

ERRORABEND is a SAS System option, causing the system to immediately exit when an error is encountered (default is to continue with obs=0)

ENDSAS and ABEND are statements; ENDSAS simply terminates the SAS job or session gracefully, while ABORT also gives you control over the exit code handed back to the operating system.

ABORT terminates the current step, sets obs=0 and lets the SAS session/job continue (default behaviour for ERRORs)

ABORT ABEND terminates the step and terminates the SAS session/job immediately.

View solution in original post

2 REPLIES 2
LinusH
Tourmaline | Level 20
From top of my head:

Errorabend ends the SAS session when an error occurs. Use when you wish to make sure that nothing else will be executed.

Endsas ends the SAS session in a nice peaceful way, at your command.

Abort also ends the session but gives you some options to leave a RC back the calling program, like a UNIX she'll, scheduler etc.
Data never sleeps
Kurt_Bremser
Super User

ERRORABEND is a SAS System option, causing the system to immediately exit when an error is encountered (default is to continue with obs=0)

ENDSAS and ABEND are statements; ENDSAS simply terminates the SAS job or session gracefully, while ABORT also gives you control over the exit code handed back to the operating system.

ABORT terminates the current step, sets obs=0 and lets the SAS session/job continue (default behaviour for ERRORs)

ABORT ABEND terminates the step and terminates the SAS session/job immediately.

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
  • 2 replies
  • 4011 views
  • 2 likes
  • 3 in conversation