Return to Archive

SAS Tip of the Month
October 2003

Sometimes a missing value needs to be coded, often for some form of frequency analysis. In the example below the missing value for gender is going to be set to '9' while male will remain '1' and female '2'. To make the change there are several solutions, three of which are given below:

   gender = min(gender,9);
   if gender = . then gender = 9;
   if missing(gender) then gender = 9;              

SAS provides many solutions to a single challenge, it is just selecting which is the best for the job on hand that is the most difficult part.

Updated October 1, 2003