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?
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