|
|
板凳

楼主 |
发表于 2012-8-24 08:50:37
|
只看该作者
Re: 去除重复保持顺序不变
[code:2t2tmxmq]data _null_;
length testcd $8;
if _n_=1 then do;
declare hash h(hashexp:4);
rc = h.defineKey('testcd');
rc = h.defineData('testcd','seq');
rc = h.defineDone();
call missing(testcd,seq);
end;
set aaa;
if h.check(key:x) then do;
seq+1;
rc=h.add(key:x,data:x,data:seq);
call symput(cats('testcd',seq),x);
end;
run;
%put _user_;[/code:2t2tmxmq] |
|