27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MATCH FILES 911<br />

• DROP cannot be used with variables created by the IN, FIRST, or LAST subcommands.<br />

• KEEP can be used to change the order of variables in the resulting file. By default, MATCH<br />

FILES first copies the variables in order from the first file, then copies the variables in<br />

order from the second file, and so on. With KEEP, variables are kept in the order in which<br />

they are listed on the subcommand. If a variable is named more than once on KEEP, only<br />

the first mention of the variable is in effect; all subsequent references to that variable<br />

name are ignored.<br />

Example<br />

MATCH FILES FILE=PARTICLE /RENAME=(PARTIC=POLLUTE1)<br />

/FILE=GAS /RENAME=(OZONE TO SULFUR=POLLUTE2 TO POLLUTE4)<br />

/DROP=POLLUTE4.<br />

• The renamed variable POLLUTE4 is dropped from the resulting file. DROP is specified<br />

after all of the FILE and RENAME subcommands, and it refers to the dropped variable by<br />

its new name.<br />

IN Subcommand<br />

IN creates a new variable in the resulting file that indicates whether a case came from the input<br />

file named on the preceding FILE subcommand. IN applies only to the file specified on<br />

the immediately preceding FILE subcommand.<br />

• IN can be used only for a nonparallel match or table lookup.<br />

• IN has only one specification—the name of the flag variable.<br />

• The variable created by IN has the value 1 for every case that came from the associated<br />

input file and the value 0 if the case came from a different input file.<br />

• Variables created by IN are automatically attached to the end of the resulting file and<br />

cannot be dropped. If FIRST or LAST is used, the variable created by IN precedes the variables<br />

created by FIRST or LAST.<br />

Example<br />

MATCH FILES FILE=WEEK10 /FILE=WEEK11 /IN=INWEEK11 /BY=EMPID.<br />

• IN creates the variable INWEEK11, which has the value 1 for all cases in the resulting file<br />

that had values in the input file WEEK11 and the value 0 for those cases that were not in<br />

file WEEK11.<br />

FIRST and LAST Subcommands<br />

FIRST and LAST create logical variables that flag the first or last case of a group of cases with<br />

the same value for the BY variables.<br />

• FIRST and LAST must follow all TABLE and FILE subcommands and any associated<br />

RENAME and IN subcommands.<br />

• FIRST and LAST have only one specification—the name of the flag variable.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!