Return to Archive

SAS Tip of the Month
May 2006

If a=1, b=. (missing) and c=3, then what does the SAS statement

d = a + b + c;

assign the value for the variable d? The answer is "." or missing as one of the numbers is missing. The correct way of summing the variables and let SAS deal with the missing correctly, i.e. ignore it from the sum, is to use the SAS statement

d = sum(a,b,c);

This last statement will produce the answer of d=4.

Updated May 1, 2006