不知道是不是这个意思,应该会有更好的方法的
data aa ;
input x y z;
cards;
111 11 1
222 22 2
333 33 3
;
run;
data bb;
set aa;
length cc $6;
cc=cats(of x y z);
keep cc;
run;
proc transpose data=bb out=bb(keep=c1-c3) prefix=c;
var cc;
run;
data ab;
if _n_=1 then set bb;
else do i1=0 to 3;
do i2=0 to 3;
do i3=0 to 3;
output;
end;
end;
end;
run;
data ab(drop=c1-c3);
length x1-x3 y1-y3 z1-z3 $3;
set ab;
x1=substr(c1,1,3);x2=substr(c1,4,2);x3=substr(c1,6,1);
y1=substr(c2,1,3);y2=substr(c2,4,2);y3=substr(c2,6,1);
z1=substr(c3,1,3);z2=substr(c3,4,2);z3=substr(c3,6,1);
run;
proc print data=tt;
var x1-x3 i1 y1-y3 i2 z1-z3 i3;
run;