User Guide

183
File Handling a
nd Fi le Transformations
Both data files must be sorted by ascending order of the key variables, and
the order of
variables on the Key Variables list must be the same as their sort
sequence.
Casesthatdonotmatchonthekeyvariablesareincludedinthemergedfilebut
are not merged with cases from the other file. Unmatched cases contain values
for only the
variables in the file from which they are taken; variables from the
other file contain the system-missing value.
External f
ile or Working data file is keyed table.
A keyed table, or table lookup file,
is a file in which data for each “case” can be applied to multiple cases in the other
data file. For example, if one file contains information on individual family members
(such as se
x, age, education) and the other file contains overall family information
(such as total income, family size, location), you can use the file of family data as
a table lookup file and apply the common family data to each individual family
member in
the merged data file.
To Me rg e Files with the Same Cases bu t Different Variables
E Open one of the data files.
E From the menus choose:
Data
Merge Fil
es
Add Varia
bles...
E
Select t
he data file to merge with the open data file.
To Select Key Variables
E Select the variables from the external file variables (+) on the Excluded Variables list.
E Select Match cases on key variables in sorted files.
E AddthevariablestotheKeyVariableslist.
The key va
riables must exist in both the working data file and the external data file.
Both data files must be sorted by ascending order of the key variables, and the order
of variables on the Key Variables list must be the same as their sort sequence.