Date: Thu, 13 Dec 2007 11:05:00 -0800
Reply-To: David Futrell <dfutrell62@yahoo.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: David Futrell <dfutrell62@yahoo.com>
Subject: Re: How to get rid of duplicates
In-Reply-To: <258899.41401.qm@web55811.mail.re3.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1
You can do this through the "Data Menu," at least in Version 15.0. You can paste the syntax from there.
Here are a few other, more elegant methods you can use in syntax. I can't take credit for these...I think I swiped them from Raynald's site.
* (best method) to delete duplicate records in a file (identical records).
SORT CASES BY ALL.
AGGREGATE OUTFILE=*
/PRESORTED
/BREAK=ALL
/N=n.
* The above syntax is capable to handle up to 4,000 variables.
* (alternative method).
SORT CASES BY all.
MATCH FILES FILE=*
/BY all
/FIRST= first.
SELECT IF first.
* To delete records with identical V1 values.
SORT CASES BY v1.
MATCH FILES FILE=*
/BY v1
/FIRST = first .
SELECT IF first.
* To delete records with identical var1, var2 and var3.
SORT CASES BY var1 var2 var3.
ADD FILES FILE=*
/BY var1 var2 var3
/FIRST=first.
SELECT IF first.
stace swayne <jladyl@yahoo.com> wrote: Dear list,
I'm working with a data set that has duplicate ID's and I would like to delete the duplicates, and so far I have been doing it manually, but I wanted to know if there is a way to do this with syntax.
All suggestions are appreciated,
thank you,
Stace
---------------------------------
Never miss a thing. Make Yahoo your homepage.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD