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.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.
Ready to level-up your skills? Choose your own adventure.