data test;
input a $ b $ c$ @;
cards;
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
;
run;
proc sql;
create table result as
select *
from (select distinct a from test)
,(select distinct b from test)
,(select distinct c from test)
order by a,b,c;
quit;
try this:
data a;
input a $ b $ c $;
cards;
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
;
data s;
if 0 then set a nobs=nn;
do until(lastt);
set a(keep=a) end=lastt;
by a;
do i=1 to nn;
set a(keep=b) point=i;
do j=1 to nn;
set a(keep=c) point=j;
output;
end;
end;
end;
run;