6 Handbook of SAS
®
DATA Step Programming
compare the value from the MISSING function with 1 by adding the NOT
operator. For example,
if not (missing(age) eq 1) then
if age > 26 then age_hi = 1; else age_hi = 0;
In SAS, any numerical value other than 0 or the missing value is consid-
ered TRUE, and the missing value and 0 are considered FALSE. Since the
MISSING function returns a numerical value with either 1 (for TRUE) or 0
(for FALSE), it is redundant to compare values from the MISSING function
with 1 explicitly. You can simply write the following:
if not missing(age) then
if age > 26 then age_hi = 1; else age_hi = 0;
In some applications, you also need to compare a numeric variable explicitly
with 1. For example, in the HEARING data set, t