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


Please Help Members By Posting Answers For Below Questions

what is sas enterprise intelligence architecture? : Sas-bi

766


What are the five ways to do a table lookup in sas? : sas-grid-administration

836


What are the different servers in sas? : sas-grid-administration

851


What is maximum number of rows and cols can be handled in SAS?

1106


what are input dataset and output dataset options? : Sas programming

824


Tell e how how dealt with..

2013


Give some examples where proc report’s defaults are same as proc print’s defaults?

902


What is the role of unrestrictive users? : sas-grid-administration

797


where are dashboard components are created and maintained? : Sas-bi

807


I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.

1934


hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana

5208


Describe what are the different levels of administrative users in sas? : sas-grid-administration

808


Define run-group processing?

811


Give some examples where proc report’s defaults are different than proc print’s defaults?

833


what is proc Index? and what is proc document?

2258