Skip to Main Content

SAS Tutorials: Missing Values

This SAS software tutorial describes what missing values are, and how SAS handles missing values for string and numeric variables.

Missing Values

SAS stores missing values differently depending on the variable type.

  • Character variables: Missing values for character variables appear as blanks.
  • Numeric variables: Missing values for numeric variables (including date variables) appear as a period.

Screenshot of VIEWTABLE view in SAS. Missing values for numeric variables are shown as periods, while missing values for character variables are shown as blank cells.

It is important to understand how SAS handles missing values when you execute statements. Depending on the statements being used, SAS might handle missing values in different ways. For example, it might treat a missing value as the lowest possible value (e.g., frequency tables in PROC FREQ), or it might omit the value from the computation (e.g., regression).

Internally, SAS treats numeric missing values as an extremely small or an extremely large number. Most of the time, the user will probably not be affected by this. In general, if you are subsetting data or doing any kind of conditional logic based on continuous numeric values, you should always explicitly tell SAS how to handle missing values first.

Your SAS help manual will help you understand how missing values are treated in the statements you are executing.

SAS automatically detects blank cells in external data files as missing values. You do not need to enter a period character in blank cells.