TERMSTMT= System Option

Specifies the SAS statements to execute when SAS terminates.
Valid in: Configuration file, SAS invocation
Category: Environment control: Initialization and operation
PROC OPTIONS GROUP= EXECMODES
Operating environment: In some operating system environments there is a limit to the size of the value for TERMSTMT=. To circumvent this limitation, you can use the %INCLUDE statement.
Note: This option can be restricted by a site administrator. For more information, see Restricted Options.

Syntax

TERMSTMT='statement(s)'

Syntax Description

'statement(s)'
is one or more SAS statements.
Length:maximum length is 2,048 characters

Details

TERMSTMT= is fully supported in batch mode. In interactive modes, TERMSTMT= is executed only when you submit the ENDSAS statement from an editor window to terminate the SAS session. Terminating SAS by any other means in interactive mode results in TERMSTMT= not being executed.
An alternate method for specifying TERMSTMT= is to put a %INCLUDE statement at the end of a batch file or to submit a %INCLUDE statement before terminating the SAS session in interactive mode.

Comparisons

TERMSTMT= specifies the SAS statements to be executed at SAS termination, and INITSTMT= specifies the SAS statements to be executed at SAS initialization.

See Also

Statements:
%INCLUDE Statement in SAS Statements: Reference
System Options: