SYNTAXCHECK System Option

In non-interactive or batch SAS sessions, specifies whether to enable syntax check mode for multiple steps.
Valid in: Configuration file, SAS invocation, OPTIONS statement, SAS System Options window
Category: Environment control: Error handling
PROC OPTIONS GROUP= ERRORHANDLING
Note: This option can be restricted by a site administrator. For more information, see Restricted Options.

Syntax

Syntax Description

SYNTAXCHECK
enables syntax check mode for statements that are submitted within a non-interactive or batch SAS session.
NOSYNTAXCHECK
does not enable syntax check mode for statements that are submitted within a non-interactive or batch SAS session.
CAUTION:
Setting NOSYNTAXCHECK might cause a loss of data.
Manipulating and deleting data by using untested code might result in a loss of data if your code contains invalid syntax. Be sure to test code completely before placing it in a production environment.

Details

If a syntax or semantic error occurs in a DATA step after the SYNTAXCHECK option is set, then SAS enters syntax check mode, which remains in effect from the point where SAS encountered the error to the end of the code that was submitted. After SAS enters syntax mode, all subsequent DATA step statements and PROC step statements are validated.
While in syntax check mode, only limited processing is performed. For a detailed explanation of syntax check mode, see Syntax Check Mode in SAS Language Reference: Concepts.
Place the OPTIONS statement that enables SYNTAXCHECK before the step for which you want it to take effect. If you place the OPTIONS statement inside a step, then SYNTAXCHECK will not take effect until the beginning of the next step.
NOSYNTAXCHECK enables continuous processing of statements regardless of syntax error conditions.
SYNTAXCHECK is ignored in the SAS windowing environment and in SAS line-mode sessions.

Comparisons

You use the SYNTAXCHECK system option to validate syntax in a non-interactive or a batch SAS session. You use the DMSSYNCHK system option to validate syntax in an interactive session by using the SAS windowing environment.
The ERRORCHECK= option can be set to enable or disable syntax check mode for the LIBNAME statement, the FILENAME statement, the %INCLUDE statement, and the LOCK statement in SAS/SHARE. If you specify the NOSYNTAXCHECK option and the ERRORCHECK=STRICT option, then SAS does not enter syntax check mode when an error occurs.

See Also

Error Processing in SAS in SAS Language Reference: Concepts