BookmarkSubscribeRSS Feed
greenhousemilk
Calcite | Level 5

Hello I have following data (column vector)

1

2

3

.

.

1060

1061

.

.

.

530000

I want to make it

500*1060 matrix.

Any help appreciated.

2 REPLIES 2
Linlin
Lapis Lazuli | Level 10

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;

PGStats
Opal | Level 21

Be careful what you wish for... Smiley Happy

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

PG

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.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 546 views
  • 0 likes
  • 3 in conversation