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
How do you debug and test your SAS programs?
What are the best sas programming practices for handling very large datasets? : sas-grid-administration
what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming
Do you know the features of sas?
Explain the difference between informat and format with an example.
Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya
Approximately what date is represented by the SAS date value of 730?
What are the difference between the sas data step and sas procs?
please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??
What is the role of unrestrictive users? : sas-grid-administration
What is the difference between INPUT and INFILE ?
How to include or exclude specific variables in a data set?
what are validation tools that are used in sas? : Sas-administrator
is data integration and etl programming is same? : Sas-di
What is the use of function Proc summary?