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.

Example<br />

* Mixing column-style and FORTRAN-like format specifications.<br />

DATA LIST 425<br />

DATA LIST FILE=PRSNL / LNAME M_INIT STREET (A20,A1,1X,A10)<br />

AGE 35-36.<br />

• FORTRAN-like format specifications are used for string variables LNAME, M_INIT, and<br />

STREET. These variables must be adjacent in the data file. LNAME is 20 characters wide<br />

and is located in columns 1–20. M_INIT is one character wide and is located in column 21.<br />

The 1X specification defines a blank column between M_INIT and STREET. STREET is 10<br />

characters wide and is located in columns 23–32.<br />

• A column-style format is used for the variable AGE. AGE begins in column 35, ends in<br />

column 36, and by default has numeric format.<br />

Freefield Data<br />

• In freefield data, column location is irrelevant, since values are not in fixed column positions.<br />

Instead, values are simply separated from each other by blanks or by commas or a<br />

specified delimiter. Any number of consecutive blanks are interpreted as one delimiter<br />

unless a blank space is explicitly specified as the value delimiter. A value cannot be split<br />

across records.<br />

• If there are not enough values to complete the last case, a warning is issued and the incomplete<br />

case is dropped.<br />

• The specified delimiter can only be used within data values if the value is enclosed in<br />

quotations marks or apostrophes.<br />

• To include an apostrophe in a string value, enclose the value in quotation marks. To<br />

include quotation marks in a value, enclose the value in apostrophes (see “String Values<br />

in <strong>Command</strong> Specifications” on p. 7).<br />

Variable Formats<br />

Two types of format specifications are available: column-style and FORTRAN-like. With<br />

each type, you can specify both numeric and string formats. The difference between the two<br />

types is that FORTRAN-like formats include the width of the variable and column-style<br />

formats do not.<br />

• Column-style formats are available only for fixed-format data.<br />

• Column-style and FORTRAN-like formats can be mixed on the same DATA LIST to define<br />

fixed-format data.<br />

• A value that cannot be read according to the format type specified is assigned the systemmissing<br />

value and a warning message is issued.<br />

The following sections discuss the rules for specifying column-style and FORTRAN-like<br />

formats, followed by additional considerations for numeric and string formats. See p. 412 for<br />

a partial list of available formats. For a complete discussion of formats, see “Variable<br />

Formats” on p. 25.

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

Saved successfully!

Ooh no, something went wrong!