Chapter Contents |
Previous |
Next |
Representing Missing Values in Input Data |
Special Missing Values in Numeric Input Data |
SAS enables you to differentiate among classes of missing values in numeric data. For numeric variables, you can designate up to 27 special missing values by using the letters A through Z, in either upper- or lowercase, and the underscore character (_).
The following example shows how to code missing values by using a MISSING statement in a DATA step:
data test_results; missing a b c; input name $8. Answer1 Answer2 Answer3; datalines; Smith 2 5 9 Jones 4 b 8 Carter a 4 7 Reed 3 5 c ; proc print; run;
Note that you must use a period when you specify a special missing numeric value in an expression or assignment statement, as in the following:
x=.d;However, you do not need to specify each special missing numeric data value with a period in your input data. For example, the following DATA step, which uses periods in the input data for special missing values, produces the same result as the input data without periods:
data test_results; missing a b c; input name $8. Answer1 Answer2 Answer3; datalines; Smith 2 5 9 Jones 4 .b 8 Carter .a 4 7 Reed 3 5 .c ; proc print; run;Output for both examples is shown in Output of Data with Special Missing Numeric Values.
Output of Data with Special Missing Numeric Values
The SAS System Obs name Answer1 Answer2 Answer3 1 Smith 2 5 9 2 Jones 4 B 8 3 Carter A 4 7 4 Reed 3 5 C |
Note: SAS displays and prints special missing values that use
letters in uppercase.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.