This works for your sample data.
Yu
proc sql noprint;
select max(f1),max(f2) into :d1,:d2 from have;
quit;
data want;
do until(last);
set have end=last;
array temp {&d1.,&d2.} _temporary_;
temp{f1,f2}=v1;
end;
last=0;
do until(last);
set have end=last;
if f1=f2 then v2=.;
else v2=temp(f2,f1);
output;
end;
stop;
run;
|
|
0
|
|
|
|
Reply
|
zhangyu05 (659)
|
11/18/2009 7:47:51 PM |
|