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.

DATA LIST 419<br />

• RECORDS can be used only for fixed-format data and must be separated from other DATA<br />

LIST subcommands by at least one blank or comma. RECORDS must precede the first<br />

slash, which signals the beginning of variable definition.<br />

• Each slash in the variable definition portion of DATA LIST indicates the beginning of a new<br />

record. The first slash indicates the first (or only) record. The second and any subsequent<br />

slashes tell the program to go to a new record.<br />

• To skip a record, specify a slash without any variables for that record.<br />

• The number of slashes in the variable definition cannot exceed the value of the integer<br />

specified on RECORDS.<br />

• The sequence number of the record being defined can be specified after each slash. DATA<br />

LIST reads the number to determine which record to read. If the sequence number is used,<br />

you do not have to use a slash for any skipped records. However, the records to be read<br />

must be in their sequential order.<br />

• The slashes for the second and subsequent records can be specified within the variable<br />

list, or they can be specified on a format list following the variable list (see the example<br />

below).<br />

• All variables to be read from one record should be defined before you proceed to the next<br />

record.<br />

• Since RECORDS can be used only with fixed format, it is not necessary to define all the<br />

variables on a given record or to follow their order in the input data file.<br />

Example<br />

DATA LIST FILE=HUBDATA RECORDS=3<br />

/2 YRHIRED 14-15 DEPT 19 SEX 20.<br />

• DATA LIST defines fixed-format data. RECORDS can be used only for fixed-format data.<br />

• RECORDS indicates that there are three records per case in the data. Only one record per<br />

case is defined in the data definition.<br />

• The sequence number (2) before the first variable definition indicates that the variables<br />

being defined are on the second record. Because the sequence number is provided, a slash<br />

is not required for the first record, which is skipped.<br />

• The variables YRHIRED, DEPT, and SEX are defined and will be included in the working<br />

data file. Any other variables on the second record or on the other records are not defined<br />

and are not included in the working file.<br />

Example<br />

DATA LIST FILE=HUBDATA RECORDS=3<br />

/ /YRHIRED 14-15 DEPT 19 SEX 20.<br />

• This command is equivalent to the one in the previous example. Because the record<br />

sequence number is omitted, a slash is required to skip the first record.<br />

Example<br />

DATA LIST FILE=HUBDATA RECORDS=3<br />

/YRHIRED (T14,F2.0) / /NAME (T25,A24).

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

Saved successfully!

Ooh no, something went wrong!