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.

Variable Names<br />

DATA LIST 423<br />

• Variable names must conform to SPSS variable naming rules. System variables (beginning<br />

with a $) cannot be defined on DATA LIST. For more information on variable naming<br />

rules, see “Variable Names” on p. 21.<br />

• The keyword TO can be used to generate names for consecutive variables in the data.<br />

Leading zeros in the number are preserved in the name. X1 TO X100 and X001 TO X100<br />

both generate 100 variable names, but the first 99 names are not the same in the two lists.<br />

X01 TO X9 is not a valid specification. For more information on the TO keyword and other<br />

variable-naming rules, see “Variable Names” on p. 21.<br />

• The order in which variables are named on DATA LIST determines their order in the<br />

working data file. If the working file is saved as an SPSS-format data file, the variables<br />

are saved in this order unless they are explicitly reordered on the SAVE or XSAVE<br />

command.<br />

Example<br />

DATA LIST FREE / ID SALARY #V1 TO #V4.<br />

• The FREE keyword indicates that the data are in freefield format. Six variables are<br />

defined: ID, SALARY, #V1, #V2, #V3, and #V4. #V1 to #V4 are scratch variables that are not<br />

stored in the working data file. Their values can be used in transformations but not in<br />

procedure commands.<br />

Variable Location<br />

For fixed-format data, variable locations are specified either explicitly using column locations<br />

or implicitly using FORTRAN-like formats. For freefield data, variable locations are<br />

not specified. Values are read sequentially in the order in which variables are named on the<br />

variable list.<br />

Fixed-Format Data<br />

• If column-style formats are used, you must specify the column location of each variable<br />

after the variable name. If the variable is one column wide, specify the column number.<br />

Otherwise, specify the first column number followed by a dash (–) and the last column<br />

number.<br />

• If several adjacent variables on the same record have the same width and format type, you<br />

can use one column specification after the last variable name. Specify the beginning<br />

column location of the first variable, a dash, and the ending column location of the last<br />

variable. the program divides the total number of columns specified equally among the<br />

variables. If the number of columns does not divide equally, an error message is issued.<br />

• The same column locations can be used to define multiple variables.<br />

• For FORTRAN-like formats, column locations are implied by the width specified on the<br />

formats (see “Variable Formats” on p. 425). To skip columns, use the Tn or nX format<br />

specifications.

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

Saved successfully!

Ooh no, something went wrong!