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
Explain the main difference between the sas procedures and functions? : Sas-administrator
what is sas business intelligence? : Sas-bi
Explain the purpose of substr functions in sas programming.
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
Explain the purpose of retain statement.
What is the role of unrestrictive users? : sas-grid-administration
Name and describe few sas character functions that are used for data cleaning in brief.
What is the difference between nodupkey and nodup options?
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
Tell e how how dealt with..
what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming
What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?
Give e an example of..
What is SAS? What are the functions does it performs?
Differentiate between sas functions and sas procedures.