Lesson 8: Writing Programs That Work - Part II

Overview Section

We've spent some time learning how SAS processes programs. Now, we'll turn our attention to the various messages that SAS displays in the log window with the intention of improving our ability to find errors in our SAS programs. Specifically, we'll investigate the log messages SAS might display:

  • when we have a missing semicolon
  • when we have used an invalid option, invalid name, or invalid statement
  • when we have a missing quotation mark
  • when our input data file contains invalid data
  • when we have misspelled a variable name
  • when our input statement has reached the end of the line
  • when our calculations generate missing values

Our intention again is to make us all more efficient SAS programmers!

Objectives

Upon completion of this lesson, you should be able to:

Upon completing this lesson, you should be able to do the following:

  • review the LOG file every time you execute a SAS program to see what errors, warnings, and notes your program caused SAS to display
  • recognize the types of error messages SAS might display in the log file when a semicolon is missing
  • appreciate the value of using the DATASTMTCHK system option
  • recognize the possible causes of receiving an error that you've used an invalid option, invalid name, or invalid statement
  • recognize the possible causes of receiving a warning informing you that a TITLE statement is ambiguous
  • recognize the possible causes of receiving a note informing you that SAS encountered invalid data
  • recognize the possible causes of receiving a note informing you that a variable is uninitialized or not found
  • recognize the possible causes of receiving a note informing you that the INPUT statement reached past the end of the line
  • recognize the possible causes of receiving a note informing you that SAS generated missing values as a result of performing an operation on missing values