TABLE Subcommand (MATCH FILES command)
TABLE specifies a table lookup (or keyed table)
file. A lookup file contributes variables but not cases to the new
active dataset. Variables from the table file are added to all cases
from other files that have matching values for the key variables. FILE specifies
the files that supply the cases.
- A separate
TABLEsubcommand must be used to specify each lookup file, and a separateFILEsubcommand must be used to specify each case file. - The
BYsubcommand is required whenTABLEis used. - All specified files must be sorted in ascending order of the key
variables. If necessary, use
SORT CASESbeforeMATCH FILES. - A lookup file cannot contain duplicate cases (cases for which
the key variable[s] named on
BYhave identical values). - An asterisk on
TABLErefers to the active dataset. - Dataset names instead of file names can be used to refer to currently open datasets.
- Cases in a case file that do not have matches in a table file are assigned system-missing values (for numeric variables) or blanks (for string variables) for variables from that table file.
- Cases in a table file that do not match any cases in a case file are ignored.
PASSWORD Keyword
The PASSWORD keyword
specifies the password required to open an encrypted IBM® SPSS® Statistics data
file. The specified value must be enclosed in quotation marks and
can be provided as encrypted or as plain text. Encrypted passwords
are created when pasting command syntax from the Save Data As dialog.
The PASSWORD keyword is ignored if the file is not
encrypted.
For an alternative to MATCH CASES with table lookup
files that does not require sorting on key variables, see STAR
JOIN.
Example
MATCH FILES FILE=*
/TABLE='/data/primary.sav'
/BY EMP_ID.
-
MATCH FILEScombines variables from the IBM SPSS Statistics data file primary.sav with the active dataset, matching cases by the variable EMP_ID. - No new cases are added to the active dataset as a result of the table lookup.
- Cases whose value for EMP_ID is not included in the primary.sav file are assigned system-missing values for variables taken from the table.