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 / singh.naveen409
proc sort data=qqq;
by name;
run;
options mlogic;
data www;
set qqq;
by name;
if first.name then serial=1
run;
data wwq (drop=serial);
set www;
if serial ne '1';
run;
Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
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?
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.
how do the in= variables improve the capability of a merge? : Sas programming
In sas admin differentiate between roles and capabilities? : sas-grid-administration
what is the difference between unique key and primary key? : Sas-di
what is proc Index? and what is proc document?
What is the sas data set? : sas-grid-administration
explain about various caches available in data integrator? : Sas-di
what is sas business intelligence? : Sas-bi
How you can read the variables that you need?
Enlist the syntax rules followed in sas statements.
What is the basic syntax of a sas program?
What are the different operating system platforms in which we can use sas? : sas-grid-administration
How do you test for missing values?
What’s the difference between var b1 – b3 and var b1 — b3?