data x5;
set x4;
by did fyear;
/*industry*/
retain ii1-i47;
if first.did then ii1=i1; else if i1=1 then ii1=i1; else ii1= ii1;
if first.did then ii2=i2; else if i2=1 then ii2=i2; else ii2= ii2;
if first.did then ii3=i3; else if i3=1 then ii3=i3; else ii3= ii3;
run;
想补足中间的从i4 - i47, 对宏和循环不是特别了解。
求论坛的大大们帮忙,不甚感激!