ABORT Statement: Windows

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

Valid in: a DATA step
Windows specifics: Action of the ABEND and RETURN options; maximum value of condition-code
See: ABORT Statement in SAS Statements: Reference

Syntax

ABORT <ABEND | RETURN | CANCEL | NOLIST> <n>;

Optional Arguments

ABEND

causes abnormal termination of the current SAS job or session for the current process. Further action is based on how your operating environment and site treat jobs that end abnormally.

RETURN

causes the immediate normal termination of the current SAS job or session. A condition code is returned indicating an error if a job ends abnormally.

n

enables you to specify a condition code that SAS returns to its calling program. The value of n must be an integer. Return codes 0 - 6 and those values greater than 997 are used by SAS.

CANCEL <FILE>

causes the execution of the submitted statements to be canceled. Results depend on the method of operation.

NOLIST

suppresses the output of all variables to the SAS log.

n

is an integer value that enables you to specify a condition code:

  • when used with the CANCEL argument, the value is placed in the SYSINFO automatic macro variable.
  • when not used with the CANCEL argument, the error code that is returned by SAS is ERROR. The value of ERROR depends on the operating system. The condition code n is returned to the operating system as the final SAS system exit code.

Details

The ABORT statement causes SAS to stop processing the current DATA step.
The ABEND and RETURN options both terminate the SAS process, job, or session.

See Also

For more information, see ABORT Statement in SAS Statements: Reference