【SAS NOTES】if then和if的区别

21 data mysas.gprsprict_cal_mer;
22 set mysas.gprsprice_cal mysas.gprsprice;
23 if shen<0.04 then shen_a=shen*10;
24 run;

 与

27 data mysas.gprsprict_cal_mer;
28 set mysas.gprsprice_cal mysas.gprsprice;
29 if shen<0.04;
30 shen_a=shen*10;
31 run;

的结果有区别,对if来讲,不符合条件的数据会直接忽略,而if then下不符合条件的数据也会保留。

原文地址:https://www.cnblogs.com/colipso/p/2890353.html