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.

416 DATA LIST<br />

Example<br />

* Column-style format specifications.<br />

DATA LIST /ID 1-3 SEX 5 (A) AGE 7-8 OPINION1 TO OPINION5 10-14.<br />

BEGIN DATA<br />

001 m 28 12212<br />

002 f 29 21212<br />

003 f 45 32145<br />

...<br />

128 m 17 11194<br />

END DATA.<br />

• The data are inline between the BEGIN DATA and END DATA commands, so the FILE<br />

subcommand is not specified. The data are in fixed format. The keyword FIXED is not<br />

specified because it is the default.<br />

• Variable definition begins after the slash. Variable ID is in columns 1 through 3. Because<br />

no format is specified, numeric format is assumed. Variable ID is therefore a numeric variable<br />

that is three characters wide.<br />

• Variable SEX is a short string variable in column 5. Variable SEX is one character wide.<br />

• AGE is a two-column numeric variable in columns 7 and 8.<br />

• Variables OPINION1, OPINION2, OPINION3, OPINION4, and OPINION5 are named using<br />

the TO keyword (see “Keyword TO” on p. 23). Each is a one-column numeric variable,<br />

with OPINION1 located in column 10 and OPINION5 located in column 14.<br />

• The BEGIN DATA and END DATA commands enclose the inline data. Note that the values<br />

of SEX are lowercase letters and must be specified as such on subsequent commands.<br />

FILE Subcommand<br />

FILE specifies the raw data file. FILE is required when data are stored in an external data file.<br />

FILE must not be used when the data are stored in a file that is included with the INCLUDE<br />

command or when the data are inline (see INCLUDE and BEGIN DATA—END DATA).<br />

• FILE must be separated from other DATA LIST subcommands by at least one blank or<br />

comma.<br />

• FILE must precede the first slash, which signals the beginning of variable definition.<br />

FIXED, FREE, and LIST Keywords<br />

FIXED, FREE, or LIST indicates the format of the data. Only one of these keywords can be<br />

used on each DATA LIST. The default is FIXED.<br />

FIXED Fixed-format data. Each variable is recorded in the same column location on the<br />

same record for each case in the data. FIXED is the default.<br />

FREE Freefield data. The variables are recorded in the same order for each case but not<br />

necessarily in the same column locations. More than one case can be entered on the<br />

same record. By default, values are separated by blanks or commas. You can also<br />

specify different value delimiters.

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

Saved successfully!

Ooh no, something went wrong!