Date: Fri, 10 Jan 1997 10:20:18 GMT
Reply-To: boelte@psy.uni-muenster.de
Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From: Jens Boelte <boelte@PSY.UNI-MUENSTER.DE>
Organization: Westfaelische Wilhelms-Universitaet, Muenster,
Germany Department of Psychology
Subject: Re: renaming multiple variables
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
> ----------------------------Original message----------------------------
> I have a client who wants to merge three datasets. The problem is that
> the datasets have duplicate variable names (e.g., v1-v225) that represent
> different things in each dataset. Therefore, the variables need to be
> renamed before merging.
>
> Is there a way to rename multiple variables in SPSS without specifying
> each variable individually? The datasets are so large that individual
> renames would be extremely cumbersome, but the menu options in SPSS Win
> 7.0 didn't appear to provide a work around. Can we do this with syntax
>
Does not the command "match files" do the job, e.g.
match files file=update /rename(v1 to v225 = n1 to n225)
/file=master
/by id.
In this example the variables v1 to v225 are renamed to n1 to n225 before
the files are matched. The id variables ensures that only cases with the
same id are matched (examples taken from the SPSS reference guide, pp.403).
If you simply want to concatenate two or more files, you rather use the
command "add files". The syntax is the same as for the "match files"
command.
add files file=file1
/rename(v1 to v225 = n1 to n225)
/file=file2
/rename(w1 to w225 = o1 to o225)
/file=file3.
with many regards
Jens Boelte
-------------------------------
Psychologisches Institut II
Fliedner Str. 21
48149 Muenster
Germany