SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Editing and Debugging SAS Programs
Interpreting Error Messages


Syntax Errors

Syntax errors generally cause SAS software to stop processing the step where the error is encountered. Common syntax errors include

  • spelling mistakes
  • forgetting semicolons
  • leaving quotation marks unbalanced
  • specifying invalid options.

You already know that information is written to the Log window while a SAS program is executing. When a program with an error is submitted, messages regarding the problem also appear in the Log window. When a syntax error is detected, the Log window
  • displays the word ERROR
  • identifies the possible location of the error
  • prints an explanation of the error.

The program below contains a syntax error. The DATA step copies the SAS data set Clinic.Admit into a new data set titled Clinic.Admitfee. The PROC step should print the values for the variables ID, Name, ActLevel, and Fee in the new data set. However, print is misspelled in the PROC PRINT statement.

     data clinic.admitfee;
        set clinic.admit;
     run;
     proc prin data=clinic.admitfee;
        var id name actlevel fee;
     run;
When the program is submitted, messages in the Log window indicate that the procedure PRIN was not found and that the SAS System stopped processing the PRINT step due to errors. No output is produced because the PRINT step fails to execute.


Log Window with Error Messages

CAUTION: Problems with your statements or data may not be evident. Therefore, it's important to review the messages in the Log window each time you submit a SAS program.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement