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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!