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?

sas-innovate-2026-white.png



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!

Register now

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