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

where to use sas business intelligence? : Sas-bi

582


how do you debug and test your sas programs? : Sas programming

561


Where do you use proc means over proc freq?

564


why is a stop statement needed for the point=option on a set statement? : Sas programming

588


what is the basic structure sas administrator? : Sas-administrator

563






How do dates work in sas?

645


what versions of sas have you used (on which platforms)? : Sas programming

584


For what purposes have you used sas macros? : sas-macro

540


What’s the difference between var b1 – b3 and var b1 — b3?

832


how are numeric and character missing values represented internally? : Sas programming

620


Mention how to limit decimal places for the variable using proc means?

643


How can you create a macro variable with in data step? : sas-macro

576


Which function is used to count the number of intervals between two sas dates?

570


what is sas enterprise intelligence architecture? : Sas-bi

544


what is data access? : Sas-di

609