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


Please Help Members By Posting Answers For Below Questions

What is the difference between the proc sql and data step?

865


it will become easy if uuu provide website linkssss and list of consultanciessssss

1733


what is change analysis in sas di ? : Sas-di

779


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

761


what is sas data set?

861


List down the reasons for choosing sas over other data analytics tools.

1034


how would you create multiple observations from a single observation? : Sas programming

766


what is the difference between infile and input? : Sas-administrator

836


Are you sensitive to code walk-throughs peer review or QC review?

2877


what is the difference between floor and ceil functions in sas? : Sas-administrator

918


This entry was posted in General. Bookmark the permalink. Post a comment or leave

4323


Explain the special input delimiters used in sas programming.

761


What are pdv and it functions?

761


How to create an external dataset with sas code?

786


Mention few capabilities of sas framework.

914