01-23-2014 05:09 AM
or use if-else logic to customize the missing cases. e.g.
if missing(A)=1 then A1=0; /* not necessarily so */
if missing(B)=1 then B1=0; /* not necessarily so */
if missing(C)=1 then C1=1; /* not necessarily so */
01-24-2014 12:34 PM
There have been many good examples on how to calculate the answer that you want. I'd like to address this in a different way (that might make sense if you consider only + and * as operators). With a missing value for A in your example, you say the answer should be 50. My question is "How do you know"? A is missing and not necessarily equal to zero. It might be anything--you just don't have information. Consequently, any function that includes A as an operand is lacking in information. SAS thus rightly treats the result as missing. If you know that A is truly equal to zero when missing, then I would write something like bill0101's if-then-else logic.