LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 13 Dec 2007 05:56:06 -0800
Reply-To:     Takeadoe <mtonkovich@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Takeadoe <mtonkovich@MSN.COM>
Subject:      finding duplicates - with a twist
Comments: To:
Content-Type: text/plain; charset=ISO-8859-1

Dear Group Members - The list is loaded with all manner of handy programs to flag duplicates. I've tested those below and they work great. However, I need to take this a step further. Each record within each duplicate group (there may be as many as 7 dups according to Last Name, First Name, and DOB) will have a date/time stamp. I want to create a new field that ranks each record within the duplicate group according to date, from oldest to most recent (first record in would get a 1 and last record in would get a 7).

Perhaps a bit of background will help. The database contains records of hunter-harvested deer. I want to identify (by First Name, Last Name, and DOB) hunters that harvested multiple deer and use the date of harvest to assign a value - 1st deer, 2nd deer, 3rd deer, and so on.

Any help is greatly appreciated.


sample code to id duplicates follows... If you can modify this, to help with my request, that would be great.

data mydata; input id; cards; 123 123 111 136 run;

proc sort data=mydata; by id; run;

data nodouble double; set mydata; by id; if and then output nodouble; else output double; run;

data out; set mydata; by id; flag = ( and ; run ;

Back to: Top of message | Previous page | Main SAS-L page