Hello I have following data (column vector)
1
2
3
.
.
1060
1061
.
.
.
530000
I want to make it
500*1060 matrix.
Any help appreciated.
data have;
do i=1 to 530000;
output;
end;
data want;
set have;
group=int((_n_-1)/1060);
proc transpose data=want(keep=col:);
var i;
by group;
run;
proc print;run;
Be careful what you wish for...
data have;
do i=1 to 500*1060;
output;
end;
run;
data want;
array x{500, 1060};
do k = 1 to 500;
do j = 1 to 1060;
set have;
x{k,j} = i;
end;
end;
drop i j k;
run;
PG
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.