Date: Tue, 12 Nov 1996 11:35:12 PST
Reply-To: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Subject: Re: Deleting multiple observations?
Marina, This is a slightly tricky problem. You should read the descriptions of
NODUP and NODUPKEY in the SORT chapter of the PROCEDURES GUIDE. The difficulty
with NODUP arises when you have data like:
KEY1 NONKEY1 NONKEY2
A 1 1
A 1 2
A 1 1
If you sort this data by KEY1 using NODUP, all three observations will be kept.
The first and third observations are duplicates, but they are each only compared
to the second observation (1 is compared to 2 and they differ, then 2 is
compared to 3 and they differ). In your case, it sounds like any records with
duplicate keys (patient ID) are complete duplicates, so you could sort by
patient ID using NODUP or NODUPKEY.
By the way, both NODUP and NODUPKEY leave one copy of the duplicates--they do
not drop ALL duplicates, and there is no simple way to get the dropped records.
People argue about which record is kept with NODUPKEY. I think it is version,
platform and host sort dependent.
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
----------------------[Reply - Original Message]----------------------
Sent by:marina djurfeldt <marina@CASEMIX.QUEENSU.CA>
Hello,
Is there an easy way to delete multiple observations of the same
subject/patient
in a database? They are all identical so there is nothing different to
base an "if-then-delete" statement on.
Thanks for any help on this.
Marina Djurfeldt
Case Mix Research
Queen's University
Canada.
marina@casemix.queensu.ca
=====================================================================