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 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 8 Sep 2005 19:07:07 -0700
Reply-To:     shiling99@YAHOO.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         shiling99@YAHOO.COM
Organization: http://groups.google.com
Subject:      Re: how to keep the duplicate records only?
Comments: To: sas-l@uga.edu
In-Reply-To:  <20050909005811.53853.qmail@web34315.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

You can check first.var and last.var to have the desired results. Here is an example.

data t1; do i = 1 to 10; x=ceil(ranuni(-1)*5); output; end; drop i; run;

proc print; run;

proc sort data=t1 ; by x; run;

data duponly; set t1; by x; if first.x+last.x=2 then delete; run;

proc print; run;

wei yi wrote: > Hello, All > I have a dataset with some duplicate records, I know > to use nodupkey to exclude the duplicate records. > But how I could keep all these duplicate records in a > file? > > Thanks, > Wei > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com


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