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


Please Help Members By Posting Answers For Below Questions

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?

634


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.

1795


how do the in= variables improve the capability of a merge? : Sas programming

931


In sas admin differentiate between roles and capabilities? : sas-grid-administration

556


what is the difference between unique key and primary key? : Sas-di

592






what is proc Index? and what is proc document?

1994


What is the sas data set? : sas-grid-administration

564


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

576


what is sas business intelligence? : Sas-bi

584


How you can read the variables that you need?

651


Enlist the syntax rules followed in sas statements.

608


What is the basic syntax of a sas program?

660


What are the different operating system platforms in which we can use sas? : sas-grid-administration

589


How do you test for missing values?

1053


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

822