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 (September 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 11 Sep 1997 16:56:41 -0500
Reply-To:   Girish S Patel <girish.s.patel@CCMAIL.CENSUS.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Girish S Patel <girish.s.patel@CCMAIL.CENSUS.GOV>
Subject:   Re: deleting duplicates
Comments:   To: lynnl@IS.DAL.CA
Content-Type:   text/plain; charset=US-ASCII

Try :

proc sort data=yourdataset name nodupkey; by id; run; data a; input id $; cards; 1 2 3 3 3 ; run;

proc print; title1 'orignal data' ; run;

proc sort data=a nodupkey ; by id; run;

proc print; title1 'after deleting dups id' ; run;

orignal data 1 16:09 Thursday, September 11, 1997

OBS ID

1 1 2 2 3 3 4 3 5 3

after deleting dups id 2 16:09 Thursday, September 11, 1997

OBS ID

1 1 2 2 3 3

______________________________ Reply Separator _________________________________ Subject: deleting duplicates Author: Lynn Nicole Lethbridge <lynnl@IS.DAL.CA> at smtp-gateway Date: 9/11/97 4:37 PM

Hi there

I have data where there are duplicates of observations. I'd like to get rid of the duplicates which appear together. Included with the data are unique identifiers for each observation. So for example in the following:

obs id 1 1 2 2 3 3 4 3 5 3

I'd like to get rid of obs 4 and 5.

The repeats always follow directly after the original observation which I keep.

Thanks so much for any help.

Lynn


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