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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1068 views
  • 0 likes
  • 1 in conversation