Date: Wed, 11 Jul 2007 16:13:23 -0300
Reply-To: Hector Maletta <hmaletta@fibertel.com.ar>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Hector Maletta <hmaletta@fibertel.com.ar>
Subject: Re: Combining Two Datafiles
In-Reply-To: <981581.8246.qm@web59215.mail.re1.yahoo.com>
Content-Type: text/plain; charset="us-ascii"
It does not matter which file's variables you rename insofar they have
different names. Example of syntax:
Both files must be sorted by the matching variables (e.g. the ID variable in
the following example).
GET FILE 'FILE1.SAV'.
RENAME VARIABLES (X1 X2 X3 = Z1 Z2 Z3).
SORT CASES BY ID.
SAVE OUTFILE 'FILE1.SAV'.
GET FILE 'FILE2.SAV'.
SORT CASES BY ID.
MATCH FILES /FILE */FILE 'FILE1.SAV'/BY ID.
SELECT IF (X1=Z1 AND X2=Z2 AND X3=Z3).
SAVE OUTFILE 'SELECTEDCASES.SAV'.
Hector
_____
From: Ucal Gyam [mailto:ucalgyam@yahoo.com]
Sent: 11 July 2007 16:05
To: Hector Maletta; SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: Combining Two Datafiles
Hector, thanks for your response.
Should I first rename the variables in the second file , add the files then
match the files ? , more details on how to do this will be much appreciated.
Thanks.
----- Original Message ----
From: Hector Maletta <hmaletta@fibertel.com.ar>
To: SPSSX-L@LISTSERV.UGA.EDU
Sent: Wednesday, July 11, 2007 2:14:07 PM
Subject: Re: Combining Two Datafiles
One possibility:
Rename the variables in one of the files to, say, Z1, Z2 and Z3.
Match the files (with all cases included). Then select the cases where X1=Z1
AND X2=Z2 AND X3=Z3.
Hector
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Ucal Gyam
Sent: 11 July 2007 14:59
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Combining Two Datafiles
Dear List,
I have 2 datafiles FileA and FileB with same variables,
I want to Create a third datafile FileC containing only records
from both
FileA and FileB Where the values of the variables x1 , x2 and x3
(ie same matching records on x1,x2 and x3) in both datafiles
are equal .
Can somebody point me the right direction.
Thanks
Ucal
____________________________________________________________________________
________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list
<http://answers.yahoo.com/dir/?link=list&sid=396546091> &sid=396546091
_____
Don't get soaked. Take a quick peak at the forecast
with theYahoo! Search weather shortcut.