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?
Answers were Sorted based on User's Feedback
Answer / imran syed
KEEP statement is the most effective form of code.
keep var-1 var-2 var-3 var-4 var-5;
| Is This Answer Correct ? | 24 Yes | 0 No |
Answer / john sikha
Use keep followed by variables you required
| Is This Answer Correct ? | 23 Yes | 2 No |
Answer / 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 |
Answer / ganesh
We can either use keep or drop option for selecting those
five variables.
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / vinod swarna
use select statement with just those 5 variables:
proc sql;
create table only5 as
select var1,var2,var3,var4,var5
from example;
quit;
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / chandra
data set options keep is best and using proc sql is also.
| Is This Answer Correct ? | 6 Yes | 0 No |
data xyz first obs=first
obs=last;
set zyx;
run;
| Is This Answer Correct ? | 0 Yes | 0 No |
How would you generate 1000 observations from a normal distribution with a mean of 50 and standard deviation of 20. How would you use PROC CHART to look at the distribution? Describe the shape of the distribution.
it will become easy if uuu provide website linkssss and list of consultanciessssss
how do i read multiple spaces in datasets? eg: vijaya raghava perumal.I tried with using & but it workss if its vijaya raghava but not for raghava perumal.how to do this?
how do you test for missing values? : Sas programming
What are the applications primarily used by business analyst? : Sas-bi
describe the interaction table in sas di? : Sas-di
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
Differentiate between sas functions and sas procedures.
Hi... this is chandu, did MSc Microbiology, trying to get job in SAS tool, PLZ Tell me whether IT industries will give consider my education to gain a job....?
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
What are the difference between ceil and floor functions in sas?
What SAS statements would you code to read an external raw data file to a DATA step?