search across all the following databases:
Data and documentation
Common questions and answers.
Entire collection of data resources.
There can be different reasons for a value to be missing.
If you need to be able to distinguish between types of missing values, SAS allows you to designate up to 27 special missing values. Data have to be read in as numeric to use these special missing values.
are represented by two characters: a decimal point followed by either a letter
or an underscore (for example,
._). The SAS System does not distinguish
between lowercase and uppercase letters (e.g.,
.A are treated the same).
You can set values to special missing values within the DATA step with program statements such as this:
if age lt 0 then age=.n;SAS also provides the MISSING statement. Ordinarily, a missing numeric value must be represented in input data by a period. By using the MISSING statement, alphabetic characters can be read and stored as special missing values rather than invalid numeric values. In the example below,
data test; missing X Y; input id score;the missing statement would allow input values X and Y to be read as special missing values (for the variables id, score). PROC PRINT would display any such values as X or Y. When the SAS System prints a special missing value, it prints only the letter or underscore.
PROC FREQ also displays the special missing value codes if the /missprint option is used.
For example if one has a variable age with valid values ranging from 1-99 and the following missing data codes:
.a inappropriate, question not asked
.d don't know
. no answer
proc freq; tables age;
would report how many cases are missing on age with no distinction among the different types of missing value codes.
proc freq; tables age / missprint;
would report how many respondents have a value of