请教各位了,我的数据data有3个变量,a,b,c均为日期型。想做下面这样的赋值,请问有没有循环语句的方法呢?
我只知道这样的笨方法,循环大概要用到do;i+1;之类的语句吧?但是不知道怎么去写了
data data1;
set data;
if a<=b<a+1 then d=1;
else if a+1<=b<a+1 then d=2;
else if a+2<=b<a+2 then d=3;
else if a+3<=b<a+3 then d=4;
else if a+4<=b<a+4 then d=5;
else if a+5<=b<a+5 then d=6;
else if a+6<=b<a+6 then d=7;
else if a+7<=b<a+7 then d=8;
else if a+8<=b<a+8 then d=9;
else if a+9<=b<a+9 then d=10;
else if a+10<=b<a+10 then d=11;
else if a+11<=b<c then d=12; /*这里是小于c*/
run;