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 (April 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 2 Apr 2007 15:49:41 -0700
Reply-To:   "harsha09@gmail.com" <harsha09@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "harsha09@gmail.com" <harsha09@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: Remove duplicates keeping only the earliest date
Comments:   To: sas-l@uga.edu
In-Reply-To:   <CA8F89971ADA9F47A6C915BA2397844203714031@MAILBE2.westat.com>
Content-Type:   text/plain; charset="iso-8859-1"

On Apr 2, 2:56 pm, HERMA...@WESTAT.COM (Sigurd Hermansen) wrote: > Since this question arises about a often as any other on the 'L, I'll > chant some of the usual caveats. First, you are defining what amount to > key, as opposed to tuple (row) duplicates. If you extend one of the many > solutions that you'll see, it may not work as expected. For example, a > missing value of the Date attribute would force most of the solutions to > choose it over others with actual date values. Second, you are asking a > machine to make arbitrary decisions about content. What if the record > with the earlier date occurs by error? > > I'll stop there for the moment. Just remember that duplicates generally > display a symptom of a data integrity problem, not the data integrity > problem itself. Deleting one of a set of duplicates amounts to much the > same thing as throwing out data that don't fit a statistical model. Not > a good thing to do blindly .... S > > > > -----Original Message----- > From: owner-sa...@listserv.uga.edu [mailto:owner-sa...@listserv.uga.edu] > > On Behalf Of sdlenter > Sent: Monday, April 02, 2007 4:41 PM > To: s...@uga.edu > Subject: Remove duplicates keeping only the earliest date > > How do I Remove duplicates keeping only the earliest date > > Example: > > Field1 field2 Field 3 Date > 1212 df gt12 20070405 > 1212 df gt12 20070409 > 1312 df gt12 20050407 > > So after removing duplicates only two will be left > 1212 df gt12 20070405 (Earliest date) > 1312 df gt12 20050407- Hide quoted text - > > - Show quoted text -

Very apt reply Sigurd Hermansen.


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