data room1 room2 room3 room4 room5 room6 room7 room8 ;
do i=1 to 8 ;
if rooms = i then output room(i) ;
end ;
run;
what should i do if i want to fix room(i)
This is not a direct answer to your question, but why do you need eight different data sets? You could keep all the data in one large data set and then do any subsequent processing with a BY statement. It's much simpler.
Thank you for your reply . but the file is too big
@LeeSeongWoo_ wrote:
Thank you for your reply . but the file is too big
Too big to do what? How do you know it is too big? Give us information, describe your actual problem instead of avoiding describing the problem.
@LeeSeongWoo_ wrote:
Thank you for your reply . but the file is too big
What is too big? You don't even reference a data set to read from to split into something smaller.
As I posted in another thread today, splitting data out into multiple datasets is really not a good idea.
NOw to do what you want, you can't refere to dataset names by using array syntax,so please post an actual example, with test data in the form of a datastep where you would want to use this, as basically all your code below is doing is creating 8 datasets with one row each, which can be achieved by:
data room1 room2...; run;
As you can see your example makes no sense at all.
Do you have an existing data set that contains the variable ROOMS? Right now, there is no data coming in via a SET or INPUT statement.
"The file is *-always-* Too Big!"
macro calltext can do this trick.
see section 3.3 Splitting a Data Set
I agree with others: not a good idea to split a data set into subsets.
Figure out how to use either a by-statement or where clause.
Ron Fehd macro function maven
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.