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.

1450 SAVE<br />

Example<br />

GET FILE=HUBEMPL.<br />

SAVE OUTFILE=EMPL88 /RENAME=(AGE=AGE88) (JOBCAT=JOBCAT88).<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 />

• SAVE causes the data to be read and saves a new SPSS-format data file with filename<br />

EMPL88. The original SPSS-format data file HUBEMPL is not changed.<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’ 9<br />

‘UNKNOWN’.<br />

SAVE OUTFILE=HUBTEMP.<br />

CROSSTABS DEPT85 TO DEPT88 BY JOBCAT.<br />

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

• The TEMPORARY command indicates that RECODE and VALUE LABELS are in effect only<br />

for the next command that reads the data (SAVE).<br />

• The RECODE command recodes values for all variables between and including DEPT85<br />

and DEPT88 on the working data file.<br />

• The VALUE LABELS command specifies new labels for the recoded values.<br />

• The OUTFILE subcommand on SAVE specifies HUBTEMP as the new SPSS-format data file.<br />

HUBTEMP will include the recoded values for DEPT85 to DEPT88 and the new value labels.<br />

• The CROSSTABS command crosstabulates DEPT85 to DEPT88 with JOBCAT. Since the<br />

RECODE and VALUE LABELS commands were temporary, the CROSSTABS output does<br />

not reflect the recoding and new labels.<br />

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

saved SPSS-format data file and the CROSSTABS output would reflect the temporary<br />

recoding and labeling of the department variables.<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.

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

Saved successfully!

Ooh no, something went wrong!