Summary - debugging errors

Summary

  1. There are five common types of syntax errors in SAS:
    - Spelling error
    - Missing Semi-colon error
    - Unbalanced Quote error
    - Missing RUN/QUIT statement
    - Invalid Options error
  2. Most of the syntax errors can be identified in the SAS log, except for the unbalanced quote error which can be identified by the unusual color of the code.
  3. When there are two Steps (e.g. Data/Proc Step) executed one after the other, the first Step does not have to end with a RUN/QUIT statement. The beginning of the second Step signals the end of the first Step.
  4. A data error is the error related to the data. Examples:
    - Age = -300
    - Sex = "K"
  5. A data error can be identified by looking at the summary statistics using Proc Means and Proc Freq.
  6. A logic error will occur when your code does not generate the intended results. It usually involves the if-then statement.​