proc sql noprint;
select count(distinct y) into :county from b;
quit;
%let county=&county;
%put &county; * to check the value;
proc sql noprint;
select distinct y into :y1-:y&county
from b;
quit;
%put _user_; * to check the macro values;
data new;
set a;
do i=1 to &county;
if index(x,&&y&i) then do;
z=trim(left(&&y&i));
i=&county; * to leave the loop;
end;
end;
run;
没有数据集,目前还没有验证,仅供参考


雷达卡



京公网安备 11010802022788号







