BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,
The data is like this:
Group Score
1 5
1 9
1 6
2 3
2 7
2 8

I guess using do statement(or similar loop) in the data step would speed the input. I know for example in matlab how to do this, but what is the equivalent code in SAS?
gim
2 REPLIES 2
deleted_user
Not applicable
Hi,
I got a solution of my own:
data test;
do group=1 to 2;
do j=1 to 3;
input score @;
output;
end;
end;
drop j;
datalines;
5 9 6 3 7 8
;

gim
deleted_user
Not applicable
... and why do you think that this is better?

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1955 views
  • 0 likes
  • 1 in conversation