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.

Example<br />

* A nested file of accident records.<br />

RECORD TYPE 1343<br />

FILE TYPE NESTED RECORD=6 CASE=ACCID 1-4.<br />

RECORD TYPE 1.<br />

DATA LIST /ACC_ID 9-11 WEATHER 12-13 STATE 15-16 (A) DATE 18-24 (A).<br />

RECORD TYPE 2.<br />

DATA LIST /STYLE 11 MAKE 13 OLD 14 LICENSE 15-16(A) INSURNCE 18-21 (A).<br />

RECORD TYPE 3.<br />

DATA LIST /PSNGR_NO 11 AGE 13-14 SEX 16 (A) INJURY 18 SEAT 20-21 (A)<br />

COST 23-24.<br />

END FILE TYPE.<br />

BEGIN DATA<br />

0001 1 322 1 IL 3/13/88 /* Type 1: accident record<br />

0001 2 1 44MI 134M /* Type 2: vehicle record<br />

0001 3 1 34 M 1 FR 3 /* Type 3: person record<br />

0001 2 2 16IL 322F /* vehicle record<br />

0001 3 1 22 F 1 FR 11 /* person record<br />

0001 3 2 35 M 1 FR 5 /* person record<br />

0001 3 3 59 M 1 BK 7 /* person record<br />

0001 2 3 21IN 146M /* vehicle record<br />

0001 3<br />

END DATA.<br />

1 46 M 0 FR 0 /* person record<br />

• FILE TYPE specifies a nested file type. The record identifier, located in column 6, is not<br />

assigned a variable name, so the default scratch variable name ####RECD is used. The<br />

case identification variable ACCID is located in columns 1–4.<br />

• Because there are three record types, there are three RECORD TYPE commands. For each<br />

RECORD TYPE there is a DATA LIST command to define variables on that record type. The<br />

order of the RECORD TYPE commands defines the hierarchical structure of the file.<br />

• END FILE TYPE signals the end of file definition.<br />

• The program builds a case for each lowest-level (type 3) record, representing each person<br />

in the file. There can be only one type 1 record for each type 2 record, and one type 2<br />

record for each type 3 record. Each vehicle can be in only one accident, and each person<br />

can be in only one vehicle. The variables from the type 1 and type 2 records are spread to<br />

their corresponding type 3 records.<br />

OTHER Keyword<br />

OTHER specifies all record types that have not been mentioned on previous RECORD TYPE<br />

commands.<br />

• OTHER can be specified only on the last RECORD TYPE command in the file definition.<br />

• OTHER can be used with SKIP to skip all undefined record types.<br />

• For nested files, OTHER can be used only with SKIP. Neither can be used separately.<br />

• If WILD=WARN is in effect for the FILE TYPE command, OTHER cannot be specified on<br />

the RECORD TYPE command.

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

Saved successfully!

Ooh no, something went wrong!