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 (July 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 18 Jul 2006 16:14:13 -0400
Reply-To:     Edward Boadi <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Edward Boadi <>
Subject:      Re: Matching two data files
Comments: To: Richard Ristow <>
Content-Type: text/plain; charset="iso-8859-1"

Thanks Richard, I am very grateful.

Warm Regards .

-----Original Message----- From: Richard Ristow [] Sent: Tuesday, July 18, 2006 4:01 PM To: Edward Boadi; SPSSX-L@LISTSERV.UGA.EDU Subject: Re: Matching two data files

At 02:44 PM 7/18/2006, Edward Boadi wrote:

>File1.sav with variables Var 1, Var2,Var3 ..... Var8 >and >File2.sav with variable Var3. > >I want to perform the following task: > >Keep all cases in File1.sav for which Var2 in File1.sav = Var2 in >File2.sav.

Yes. Not very hard. Except for one caveat, below. And I assume you mean 'var3', above, since File2.sav contains only var3.

First, combine the files. This is not tested, and has BIG CAVEAT.

MATCH FILES /FILE=File1.sav/ /FILE=File2.sav/RENAME=(var3=var3.2).

* CAVEAT: You don't have any shared key between your files, . * to use a "/BY" subcommand. Matching without a "/BY" is . * legal (it's called a "parallel match"), but unwise. . * You have no check whatever that matched records correspond.

SELECT IF (var3 EQ var3.2). * CAVEAT: This will reject any case for which var3 is . * missing in either input file. .

* You'll have 'var3.2' in the final file. Delete it, if you . * like. .

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