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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

86 ADD FILES<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 on the BY variables. FIRST and LAST must follow all FILE subcommands and<br />

their associated RENAME and IN subcommands.<br />

• FIRST and LAST have only one specification, the name of the flag variable.<br />

• FIRST creates a variable with value 1 for the first case of each group and value 0 for all<br />

other cases.<br />

• LAST creates a variable with value 1 for the last case of each group and value 0 for all<br />

other cases.<br />

• Variables created by FIRST and LAST are automatically attached to the end of the<br />

resulting file and cannot be dropped.<br />

Example<br />

ADD FILES FILE=SCHOOL1 /FILE=SCHOOL2<br />

/BY=GRADE /FIRST=HISCORE.<br />

• The variable HISCORE contains value 1 for the first case in each grade in the resulting file<br />

and value 0 for all other cases.<br />

MAP Subcommand<br />

MAP produces a list of the variables included in the new working file and the file or files from<br />

which they came. Variables are listed in the order in which they exist in the resulting file.<br />

MAP has no specifications and must follow after all FILE and RENAME subcommands.<br />

• Multiple MAP subcommands can be used. Each MAP subcommand shows the current status<br />

of the working file and reflects only the subcommands that precede the MAP subcommand.<br />

• To obtain a map of the working data file in its final state, specify MAP last.<br />

• If a variable is renamed, its original and new names are listed. Variables created by IN,<br />

FIRST, and LAST are not included in the map, since they are automatically attached to the<br />

end of the file and cannot be dropped.

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

Saved successfully!

Ooh no, something went wrong!