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


Please Help Members By Posting Answers For Below Questions

What are the automatic variables for macro? : sas-macro

678


What is the work of tranwrd function?

672


How can you limit the variables written to output dataset in data step?

757


Explain translate function?

634


Define run-group processing?

583






explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

546


What is the difference between nodupkey and nodup options?

597


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

550


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

593


how can you create zero observation dataset? : Sas programming

643


How would you invoke a macro? : sas-macro

555


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.

1803


Give an example where SAS fails to convert character value to numeric value automatically?

608


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

834


explain about various caches available in data integrator? : Sas-di

581