1#马甲2号 data a;
input a;
datalines;
.
1
2
5
6
.
8
9
.
; run; proctranspose data=a out=b; run; data c;
set b;
array h(9) col1-col9;
do y=1 to dim(h);
x=y-1; z=y+1;
if missing(h(y)) and y=1 then h(y)=h(z)/2; else
if missing(h(y)) and y=dim(h) then h(y)=h(x)/2; else
if missing(h(y)) then h(y)=(h(x)+h(z))/2;
end;
drop x y z ; run; proctranspose data=c out=d (drop=_name_); run;