【sas proc sql】缺失值的替换
1 proc sql; 2 select date,coalesce(gtone,1) as z_gtone,sum(calculated z_gtone) from &dataset; 3 quit; 4 proc sql; 5 select * from &dataset 6 where gtone is missing; 7 quit;
对于数据中的缺失值,可以用coalesce函数来对缺失值进行替换,在标准sql语句中等同于ifnull函数。
1 proc sql; 2 select date,coalesce(gtone,1) as z_gtone,sum(calculated z_gtone) from &dataset; 3 quit; 4 proc sql; 5 select * from &dataset 6 where gtone is missing; 7 quit;
对于数据中的缺失值,可以用coalesce函数来对缺失值进行替换,在标准sql语句中等同于ifnull函数。