Chapter Contents

Previous

Next
ABORT

ABORT



Stops executing the current DATA step, SAS job, or SAS session

Valid: in a DATA step
Category: Action
Type: Executable


Syntax
Without Arguments
Arguments
Details
Comparisons
Examples
See Also

Syntax

ABORT <ABEND | RETURN> <n>;


Without Arguments

If you specify no argument, the ABORT statement produces these results under the following methods of operation:

batch mode and noninteractive mode

windowing environment

interactive line mode
stops processing the current DATA step. Any further DATA steps or procedures execute normally.


Arguments

ABEND
causes abnormal termination of the current SAS job or session. Results depend on the method of operation:

RETURN
causes the immediate normal termination of the current SAS job or session. Results depend on the method of operation:

n
is an integer value that enables you to specify a condition code that SAS returns to the operating environment when it stops executing.

Operating Environment Information:   The range of values for n depends on your operating environment.  [cautionend]


Details

The ABORT statement causes SAS to stop processing the current DATA step. What happens next depends on

The ABORT statement usually appears in a clause of an IF-THEN statement or a SELECT statement that is designed to stop processing when an error condition occurs.

Note:   When you execute an ABORT statement in a DATA step, SAS does not use data sets that were created in the step to replace existing data sets with the same name.  [cautionend]

Operating Environment Information:   The only difference between the ABEND and RETURN options is that with ABEND further action is based on how your operating environment and site treat jobs that end abnormally. RETURN simply returns a condition code that indicates an error.  [cautionend]


Comparisons


Examples

This example uses the ABORT statement as part of an IF-THEN statement to stop execution of SAS when it encounters a data value that would otherwise cause a division-by-zero condition.

if volume=0 then abort 255;
   density=mass/volume;

The n value causes SAS to return the condition code 255 to the operating environment when the ABORT statement executes.

See Also

Statement:

STOP


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.