今回はORDER BYについて解説します。
/* order by_1 */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=2222; Id2=2222; Id3=2222;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
run;
proc sql;
create table data2 AS
select * from data1
order by Id1;
quit;


- order byで並び替えて出力できる。
/* order by_2 */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
Id1=2222; Id2=2222; Id3=2222;
output;
run;
proc sql;
create table data2 AS
select * from data1
order by Id1;
quit;


- order byで並び替えて出力できる。