|
|
沙发

楼主 |
发表于 2009-11-29 12:14:00
|
只看该作者
Re: 求助:查找问题?
先扔块砖,开始想用SQL的,但没能实现
[code:m8jl25ls]data a (keep=d1-d6);
array hm[8] (1 2 3 4 5 6 7 8);
do i1=1 to dim(hm); d1=hm{i1};
do i2=i1+1 to dim(hm); d2=hm{i2};
do i3=i2+1 to dim(hm); d3=hm{i3};
do i4=i3+1 to dim(hm); d4=hm{i4};
do i5=i4+1 to dim(hm); d5=hm{i5};
do i6=i5+1 to dim(hm); d6=hm{i6};
output;
end; end; end; end; end; end;
run;
data b;
input x d1 d2 d3 d4;
cards;
1 2 3 7 8
2 3 4 5 7
;
data b_temp;
set b end=eof;
string=catx(' ',of d:);
if eof then call symputx('n',_n_);
run;
proc transpose data=b_temp out=b_temp(keep=p:) prefix=p;
var string;
run;
data c(keep=d: xh);
length xh $10;
set a;
if _n_=1 then set b_temp;
string=catx(' ',of d1-d6);
array flag{&n} $ f1-f&n;
array parameter{&n} p1-p&n;
do i=1 to &n;
if not verify(parameter(i),string) then flag(i)=put(i,best8.);
end;
xh=catx(',',of flag(*));
run;[/code:m8jl25ls] |
|