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 / soniya
in data set - use keep
in proc step- use var ,id statements
ex-
data a;
infile urfilename;
input score1-score100;
keep sore1-score5;
run;
input a;
input score1-scor100
run;
proc print data=a;
var score1-score5;
id score1-score5;
run;
observe id-in this statement nuber of obs not displed in
out put
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the automatic variables for macro? : sas-macro
What is the work of tranwrd function?
How can you limit the variables written to output dataset in data step?
Explain translate function?
Define run-group processing?
explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di
What is the difference between nodupkey and nodup options?
what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming
what are validation tools that are used in sas? : Sas-administrator
how can you create zero observation dataset? : Sas programming
How would you invoke a macro? : sas-macro
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
Give an example where SAS fails to convert character value to numeric value automatically?
What’s the difference between var b1 – b3 and var b1 — b3?
explain about various caches available in data integrator? : Sas-di