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

How do you debug and test your SAS programs?

1046


What are the best sas programming practices for handling very large datasets? : sas-grid-administration

565


what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming

545


Do you know the features of sas?

592


Explain the difference between informat and format with an example.

684






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

1349


Approximately what date is represented by the SAS date value of 730?

747


What are the difference between the sas data step and sas procs?

608


please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??

1661


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

571


What is the difference between INPUT and INFILE ?

754


How to include or exclude specific variables in a data set?

646


what are validation tools that are used in sas? : Sas-administrator

591


is data integration and etl programming is same? : Sas-di

576


What is the use of function Proc summary?

653