|
|
Re: 求助宏变量中如何去除重复的
受启发,D版一个
还是喜欢弄到data步中弄..
[code:23ou655x]%let var=a c b c a c d f a d d f;
%macro nodup(var);
data _null_;
lst=scan("&var",1);
do i=2 to count("&var"," ")+1;
if index(lst,scan("&var",i,""))=0 then lst=compbl(lst||" "||scan("&var",i," "));
end;
call symput("lst",lst);
run;
%mend nodup;
%put &lst;[/code:23ou655x] |
|