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.

426 DATA LIST<br />

Column-Style Format Specifications<br />

The following rules apply to column-style formats:<br />

• Data must be in a fixed format.<br />

• Column locations must be specified after variable names. The width of a variable is determined<br />

by the number of specified columns. See “Fixed-Format Data” on p. 423 for information<br />

on specifying column location.<br />

• Following the column location, specify the format type in parentheses. The format type<br />

applies only to the variable or the list of variables associated with the column location<br />

specification immediately before it. If no format type is specified, numeric (F) format is<br />

used.<br />

• To include decimal positions in the format, specify the format type followed by a comma<br />

and the number of decimal positions. For example, (DOLLAR) specifies only whole dollar<br />

amounts; (DOLLAR,2) specifies DOLLAR format with two decimal positions.<br />

• Since column positions are explicitly specified, the variables can be named in any order.<br />

FORTRAN-like Format Specifications<br />

The following rules apply to FORTRAN-like formats:<br />

• Data can be in either fixed or freefield format.<br />

• Column locations cannot be specified. The width of a variable is determined by the width<br />

portion (w) of the format specification. The width must specify the number of characters<br />

in the widest value.<br />

• One format specification applies to only one variable. The format is specified in parentheses<br />

after the variable to which it applies. Alternatively, a variable list can be followed<br />

by an equal number of format specifications contained in one set of parentheses. When a<br />

number of consecutive variables have the same format, the number can be used as a multiplying<br />

factor preceding the format. For example, (3F5.2) assigns the format F5.2 to three<br />

consecutive variables.<br />

• For fixed data, the number of formats specified (either explicitly or implied by the multiplication<br />

factor) must be the same as the number of variables. Otherwise, the program<br />

issues an error message. If no formats are specified, all variables have the default format<br />

F8.2.<br />

• For freefield data, variables with no specified formats take the default F8.2 format.<br />

However, an asterisk (*) must be used to indicate where the default format stops. Otherwise,<br />

the program tries to apply the next specified format to every variable before it and<br />

issues an error message if the number of formats specified is less than the number of variables.<br />

• For freefield data, width and decimal specifications are not used to read the data but are<br />

assigned as print and write formats for the variable.<br />

• For fixed data, Tn can be used before a format to indicate that the variable begins at the<br />

nth column, and nX can be used to skip n columns before reading the variable. When Tn<br />

is specified, variables named do not have to follow the order of the variables in the data.

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

Saved successfully!

Ooh no, something went wrong!