When you add missing numbers with the plus (+) sign, SAS will return a missing value. If you still wish to calculate the sum and treat the missing values as zeroes, use the sum function. You wouldn't need to add the if condition, since it will calculate the average for each row. data new;
set have;
trans_avg=(sum(trans_max, trans_min)) / 2;
run; Reference: http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245953.htm http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#p17j9efnrdlz0gn1d19ete4ik8sb.htm
... View more