you have a data set like this.
data qqq;
input name $ total;
cards;
qq 22
ww 33
qq 22
ee 44
rr 33
ww 44
;
run;
and you want output like this.........
name total
qq 22
ww 44
Do it by data set step.
Answer Posted / bharath
data qqq;
input name $ total;
cards;
qq 22
ww 33
qq 22
ee 44
rr 33
ww 44
;
run;
data abc;
set qqq;
if total in (22,44) and name in ('qq', 'ww');
proc print;
run;
data abc1;
set abc;
by name;
if first.name;
run;
proc print;
run;
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Difference between informat and format?
what is sas and what are the functions? : Sas-administrator
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
what are input dataset and output dataset options? : Sas programming
Explain the use of proc gplot? : sas-grid-administration
How to sort in descending order?
what is the effect of the options statement errors=1? : Sas programming
explain what is data set in sas? : Sas-administrator
what are sas/access and sas/connect? : Sas programming
what are the best practices to process the large data sets in sas programming? : Sas-administrator
What is the difference between reading data from an external file and reading data from an existing data set?
Mention what is SAS data set?
What is a put statement?
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?
Explain the difference between nodup and nodupkey options?