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.

1452 SAVE<br />

Example<br />

GET FILE=PRSNL.<br />

COMPUTE TENURE=(12-CMONTH +(12*(88-CYEAR)))/12.<br />

COMPUTE JTENURE=(12-JMONTH +(12*(88-JYEAR)))/12.<br />

VARIABLE LABELS TENURE ’Tenure in Company’<br />

JTENURE ’Tenure in Grade’.<br />

SAVE OUTFILE=PRSNL88 /DROP=GRADE STORE<br />

/KEEP=LNAME NAME TENURE JTENURE ALL.<br />

• The variables TENURE and JTENURE are created by COMPUTE commands and assigned<br />

variable labels by the VARIABLE LABELS command. TENURE and JTENURE are added to<br />

the end of the working data file.<br />

• DROP excludes variables GRADE and STORE from file PRSNL88. KEEP specifies that<br />

LNAME, NAME, TENURE, and JTENURE are the first four variables in file PRSNL88,<br />

followed by all remaining variables not specified on DROP. These remaining variables are<br />

saved in the same sequence as they appear in the original file.<br />

RENAME Subcommand<br />

RENAME changes the names of variables as they are copied into the new SPSS-format data<br />

file.<br />

• The specification on RENAME is a list of old variable names followed by an equals sign<br />

and a list of new variable names. The same number of variables must be specified on<br />

both lists. Keyword TO can be used in the first list to refer to consecutive variables in<br />

the working data file and in the second list to generate new variable names. The entire<br />

specification must be enclosed in parentheses.<br />

• Alternatively, you can specify each old variable name individually, followed by an equals<br />

sign and the new variable name. Multiple sets of variable specifications are allowed. The<br />

parentheses around each set of specifications are optional.<br />

• RENAME does not affect the working data file. However, if RENAME precedes DROP or<br />

KEEP, variables must be referred to by their new names on DROP or KEEP.<br />

• Old variable names do not need to be specified according to their order in the working<br />

data file.<br />

• Name changes take place in one operation. Therefore, variable names can be exchanged<br />

between two variables.<br />

• Multiple RENAME subcommands are allowed.<br />

Example<br />

SAVE OUTFILE=EMPL88 /RENAME AGE=AGE88 JOBCAT=JOBCAT88.<br />

• RENAME specifies two name changes for the file EMPL88: the variable AGE is renamed to<br />

AGE88 and the variable JOBCAT is renamed to JOBCAT88.<br />

Example<br />

SAVE OUTFILE=EMPL88 /RENAME (AGE JOBCAT=AGE88 JOBCAT88).

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

Saved successfully!

Ooh no, something went wrong!