Need inputs in below query:
We want a smaller dateset from a huge dateset(having 10000 variable) based on a condition , and also creating a new variable.
What are options and statements you are going to prefer ?
and out of 10000 variables we need few only.
Please suggest
Generally best not to do this, turning one large data set into 4 or 5 smaller ones is not a good thing to do, unless you have a very good reason.
Using SASHELP.CLASS as an example, you can use portions of the data set as needed, without creating separate data sets.
proc print data=sashelp.class(where=(sex='M'));
run;
proc print data=sashelp.class(where=(sex='F'));
run;
How can we create 4 to 5 datasets , based on different condition in single code ?
Generally best not to do this, turning one large data set into 4 or 5 smaller ones is not a good thing to do, unless you have a very good reason.
Using SASHELP.CLASS as an example, you can use portions of the data set as needed, without creating separate data sets.
proc print data=sashelp.class(where=(sex='M'));
run;
proc print data=sashelp.class(where=(sex='F'));
run;
Please be more specific about the condition regarding how to choose the records that wind up in the output data set.
Please provide a portion of the large data set following these instructions, and not via any other method.
I have merged both posts.
What does "huge" mean? Give some numbers!
And having 10k variables is a design-fault, so fix that problem during creation of the dataset, not afterwards.
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.