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.

Limitations<br />

Example<br />

• Maximum 10 XSAVE commands are allowed in a session.<br />

XSAVE 1681<br />

GET FILE=HUBEMPL.<br />

XSAVE OUTFILE=EMPL88 /RENAME=(AGE=AGE88) (JOBCAT=JOBCAT88).<br />

MEANS RAISE88 BY DEPT88.<br />

• The GET command retrieves the SPSS-format data file HUBEMPL.<br />

• The RENAME subcommand renames variable AGE to AGE88 and variable JOBCAT to<br />

JOBCAT88.<br />

• XSAVE is not executed until the program reads the data for procedure MEANS. The<br />

program saves file EMPL88 and generates a MEANS table in a single data pass.<br />

• After MEANS is executed, the HUBEMPL file is still the working data file. Variables AGE<br />

and JOBCAT retain their original names in the working file.<br />

Example<br />

GET FILE=HUBEMPL.<br />

TEMPORARY.<br />

RECODE DEPT85 TO DEPT88 (1,2=1) (3,4=2) (ELSE=9).<br />

VALUE LABELS DEPT85 TO DEPT88 1 ’MANAGEMENT’ 2 ’OPERATIONS’ 3 ’UNKNOWN’.<br />

XSAVE OUTFILE=HUBTEMP.<br />

CROSSTABS DEPT85 TO DEPT88 BY JOBCAT.<br />

• Both the saved data file and the CROSSTABS output will reflect the temporary recoding<br />

and labeling of the department variables.<br />

• If SAVE were specified instead of XSAVE, the data would be read twice instead of once<br />

and the CROSSTABS output would not reflect the recoding.<br />

OUTFILE Subcommand<br />

OUTFILE specifies the SPSS-format data file to be saved. OUTFILE is required and can be<br />

specified only once. If OUTFILE is specified more than once, only the last OUTFILE is in<br />

effect.<br />

DROP and KEEP Subcommands<br />

DROP and KEEP are used to save a subset of variables. DROP specifies the variables not to<br />

save in the new data file, while KEEP specifies the variables to save in the new data file; variables<br />

not named on KEEP are dropped.<br />

• Variables can be specified in any order. The order of variables on KEEP determines the<br />

order of variables in the SPSS-format data file. The order on DROP does not affect the<br />

order of variables in the SPSS-format data file.

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

Saved successfully!

Ooh no, something went wrong!