/*******************************************************************/ /* Rule : Numeric missing value arithmetic ********** let X Non-missing value Y Missing value Then X+Y is a Missing value X-Y is a Missing value X*Y is a Missing value X/Y or Y/X is a Missing value **************************************************/ data test; x=2; y=.; z=.m; /* x: Numeric value, y: Missing value, z: Special missing value */ /* eg. Addition, subtraction, multiplication, division */ add1=x+y; subs1= x-y; mult1= x*y; div1= x/y; add2=x+z; subs2= x-z; mult2= x*z; div2= x/z; add3=y+z; subs3= y-z; mult3= y*z; div3= y/z; /* Results of all add, subs, mult and div values are become missing*/ /* Exception */ add4=sum(x,y); /* Interesting ! add4=2 is a non missing */ run; /* to see the result */ proc print data=test; run; /* Result Obs x y z add1 subs1 mult1 div1 add2 subs2 mult2 div2 add3 subs3 mult3 div3 add4 1 2 . M . . . . . . . . . . . . 2 */
Learn More : http://www.sfu.ca/sasdoc/sashtml/lrcon/z0989183.htm