search across all the following databases:
Data and documentation
Common questions and answers.
Entire collection of data resources.
Within the SAS System, a missing value for a variable is smaller than all other values.
Because missing values are smaller than all other values, you need to be careful when making numeric comparisons in your SAS programs. In the code below,
if age lt 85 then rage=85;age values of 0-84 will be recoded into rage with a value of 85. What you might not expect -- or want, is that rage will also be coded with a value of 85 when the value of age is 'missing'. To avoid such errors, you would need to check for missing values and provide alternate code when they are found.
To check for ordinary missing values, your code could be:
if age =. then do;