Date: Sun, 16 Feb 1997 16:04:04 GMT
Reply-To: lpogoda@AOL.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: lpogoda@AOL.COM
Organization: AOL http://www.aol.com
Subject: Re: Outputting duplicates
In article <5dvvcr$ga@news1.voicenet.com>, donaldc@voicenet.com (Christopher W.
Donald) writes:
>Lori Ver Steeg (lorivs@worf.netins.net) wrote:
>: I have a data set which contains data for the same person in two separate
>: records. I have one field (name) that is the same for both records. I
>: need to create a file which contains both complete records for any
>: duplicates in the name field.
>
>: EG my file may resemble the following:
>
>: name var1 var2
>: Smith 1 1
>: Smith 1 2
>: Jones 1 1
>
>: I need the new file to contain
>
>: Smith 1 1
>: Smith 1 2
>
>: Any help would be appreciated.
Try something like:
PROC SORT DATA = INDATA OUT = OUTDATA;
BY NAME;
DATA DUPES;
SET OUTDATA;
BY NAME;
IF FIRST.NAME AND LAST.NAME THEN DELETE;
RUN;
|