BookmarkSubscribeRSS Feed
mariopellegrini
Pyrite | Level 9

with the NOSYNTAXCHECK options you should avoid the "ERROR:" in the log, but in this example code, inserting the wrong libname engine (basex instead of base), SAS log still returns error. how to do?

 

options NOSYNTAXCHECK;

libname tmp basex "path";

4 REPLIES 4
Kurt_Bremser
Super User

The SYNTAXCHECK and NOSYNTAXCHECK options only control how SAS continues after an ERROR has been detected (NOSYNTAXCHECK - continue as usual, SYNTAXCHECK - only check syntax, but do not execute code). ERRORs themselves are always reported.

mariopellegrini
Pyrite | Level 9
OK thanks. But then I do not understand why with options SYNTAXCHECK it continues to run after an error. for example, the next date step should not execute it, instead it creates table t

options SYNTAXCHECK;

libname tmp basex "path";
data t;
x=2;
run;
ballardw
Super User

@mariopellegrini wrote:
OK thanks. But then I do not understand why with options SYNTAXCHECK it continues to run after an error. for example, the next date step should not execute it, instead it creates table t

options SYNTAXCHECK;

libname tmp basex "path";
data t;
x=2;
run;

MODE of operation : batch or interactive and the type of error and other options. The system option ERRORCHECK=NORMAL tells SAS not to enter syntax-check mode for errors in LIBNAME or FILENAME statements. ERRORCHECK=STRICT would do so.

Option ERRORABEND and ERRORBYABEND would terminate SAS the program also affects behavior of syntax checking.

 

 

The "syntax check" when running in non-batch mode (depending on other options) only checks the remaining syntax of a data step or procedure where the error occurs. If following data step or procedures do not contain errors in interactive modes then they execute normally barring other program statements such as ABORT

SuryaKiran
Meteorite | Level 14

with the NOSYNTAXCHECK options you should avoid the "ERROR:" in the log

 

This is not true, if this option is set then sas system will not enter syntax check mode when relevant errors occur, and instead continues to run code after the point where the errors occurred. 

 

Most of the situations this will be a default option. Check your options running this.

proc options;
run;

Also SYNTAXCHECK | NOSYNTAXCHECK is for non-interactive or batch session. DMSSYNCHK | NODMSSYNCHK in the windowing environment.

 

FYI....read this paper for more understanding An Overview of Syntax Check Mode and Why it is Important

 

Thanks,
Suryakiran

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 4991 views
  • 3 likes
  • 4 in conversation