Date: Mon, 7 Apr 2008 09:47:04 -0700
Reply-To: Dennis Deck <DDeck@rmccorp.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Dennis Deck <DDeck@rmccorp.com>
Subject: Re: Merge More Than One File At A Time
Content-Type: text/plain; charset="us-ascii"
Hans, your example should work fine.
Let me just add that you want to make sure that:
1) each table is sorted on the key variable(s)
2) each /Table has only one record per case
3) make sure your key variable(s) in each file is defined the same
(eg, if it is a string, make sure it is the same length in each
file)
Syntax examples:
* join related tables to a master file .
MATCH FILES
File= *
/Table= 'Table1.sav'
/Table= 'Table2.sav'
/By= ID /Map .
* if you have already read and named files using DATASET NAME .
MATCH FILES
File= *
/Table= Table1
/Table= Table2
/By= ID .
* determine if all records were matched (Linked is 0 if no match, 1 if
matched) .
MATCH FILES
File= Student
/Table= School /IN= Linked
/By= StudentID Year /Map .
FREQUENCES Vars= Linked .
Dennis Deck, PhD
RMC Research Corporation
111 SW Columbia Street, Suite 1200
Portland, Oregon 97201-5843
voice: 503-223-8248 x715
voice: 800-788-1887 x715
fax: 503-223-8248
ddeck@rmccorp.com
-----Original Message-----
From: Art Kendall [mailto:Art@DrKendall.org]
Sent: Saturday, April 05, 2008 5:49 AM
Subject: Re: Merge More Than One File At A Time
The documentation says that you can.
I cannot test this because I am moving to a newer PC and need to figure
out licenses.
However for version 16 <help> says (emphasis added) says
MATCH FILES FILE={'savfile'|'dataset'} *[TABLE={'savfile'|'dataset'}]
*
{* } {* }
[/RENAME=(old varnames=new varnames)...]
[/IN=varname]
/FILE=... *[TABLE= ...]*
[/BY varlist]
[/MAP]
[/KEEP={ALL** }] [/DROP=varlist]
{varlist}
[/FIRST=varname] [/LAST=varname]
the version 9 manual says: (emphasis added) A separate TABLE command
must be used to specify *each *lookup file . . ..
Art Kendall
Social Research Consultants
Hans Chen wrote:
> Dear Listers
>
> I have a main file which has 100 variables, and also I have 5 files. I
> just wonder whether I can merge then at one time? Althorugh I know We
> can merge them one file each time? Your suggestion will be highly
appreciated.
>
> Thanks!
>
> ======================
> MATCH FILES /FILE=*
> /TABLE='C:\Documents and Settings\Hans\My Documents\FILE1.sav'
> /TABLE='C:\Documents and Settings\Hans\My Documents\FILE2.sav'
> /TABLE='C:\Documents and Settings\Hans\My Documents\FILE3.sav'
> /TABLE='C:\Documents and Settings\Hans\My Documents\FILE4.sav'
> /TABLE='C:\Documents and Settings\Hans\My Documents\FILE5.sav'
> /BY RESPNO.
> EXECUTE.
> --
> Hans Chen
> Canada
>
> =====================
> 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
>
>
>
=====================
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