xgnfly 发表于 2010-5-23 17:40 
将以下数据
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
转换为
A1 B1 C1
A1 B1 C2
A1 B1 C3
A1 B1 C4
A1 B2 C1
A1 B2 C2
A1 B2 C3
A1 B2 C4
A1 B3 C1
A1 B3 C2
A1 B3 C3
A1 B3 C4
.
.
.
.
.
It seems you want to have a Cartesian Joint. Note the joint size grows VERY fast.
Here is an example.
data tmp;
input (a b c) (: $2.) ;
cards;
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
;
proc sql;
select t1.a, t2.b, t3.c
from tmp t1,tmp t2, tmp t3
order by 1, 2, 3
;
quit;