If you have a data set that contains 100 variables, but you
need only five of those, what is the code to force SAS to
use only those variable?
Answer Posted / ram pabba
It is true to use KEEP option on a dataset to only select
few variables from 100 variables.
We can use KEEP option either on set statement or data
step statement. If we use on SET statement then only the
five variables are created on pdv and only these variables
are sent to the output dataset. If we use KEEP option on
data step statement then all the variables are copied into
pdv and after any maniuplation only the selected variables
on data step statement are processed and sent to output
dataset.
data abc;
set xyz (keep= ab cd ef gh);
run;
data abc(keep= ab cd ef gh ij);
set xyz;
ij=ab+jk;
run;
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
In sas, what are the areas that you are most interested in? : sas-grid-administration
What do you know about symput and symget?
How long can a macro variable be? A token? : sas-macro
What are common programming errors committed in sas
how to read the variables in sas? : Sas-administrator
how do the in= variables improve the capability of a merge? : Sas programming
what can you learn from the sas log when debugging? : Sas programming
Give some ways by which you can define the variables to produce the summary report (using proc report)?
Are you involved in writing the inferential analysis plan? Tables specifications?
what is snowflake schema? : Sas-di
How necessary is it to be creative in your work?
Mention what is SAS data set?
what is star schema? : Sas-di
why a stop statement is needed for the point= option on a set statement?
How is character variable converted into numeric variable and vice versa?