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 / aravind9882
u can use keep dataset option or keep statement to limit
the no of variables depending on ur requirement. if u want
process only those 5 variables, u can use keep dataset
option. if u want to limit d variables after d data is
processed u can use keep statement.
data new;
set old(keep=v1 v2 v3 v4 v5);
run;
or
data new;
set old;
keep v1 v2 v3 v4 v5;
run;
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
What is SAS informats?
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
Explain the purpose of retain statement.
What is the difference between input and infile statement?
what is function of retain statment
What is the role of sas grid administrator? : sas-grid-administration
Did you used proc test? when?
How to test the debugging in sas?
what are _numeric_ and _character_ and what do they do? : Sas programming
What are the difference between the sas data step and sas procs?
What do you know about symput and symget?
how do you debug and test your sas programs? : Sas programming
how many types prompting framework can be broken down to? : Sas-bi