Of course when genie_reinhard has answered, others can retire but so bored today
data have;
input var1;
cards;
7
1
6
4
3
8
;
data _null_;
if _n_=1 then do;
dcl hash H (ordered: "d") ;
h.definekey ("_n_") ;
h.definedata ("var1") ;
h.definedone () ;
end;
set have end=lr;
rc=h.add();
if lr then h.output(dataset:'want');
run;
And likely not to be terribly efficient or generalizable but
data have;
input var1;
datalines;
7
1
6
4
3
8
;
run;
proc transpose data=have out=want;
run;
data _null_;
set want;
file print;
array c col: ;
do i= dim(c) to 1 by -1;
put c[i];
end;
run;
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.