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.

578 FILE TYPE—END FILE TYPE<br />

Example<br />

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

* Issue a warning for duplicate record types.<br />

FILE TYPE NESTED RECORD=6 CASE=ACCID 1-4 DUPLICATE=WARN.<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 /* accident record<br />

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

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

0001 2 1 31IL 134M /* duplicate vehicle 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 />

• In the data, there are two vehicle (type 2) records above the second set of person (type 3)<br />

records. This implies that an empty (for example, parked) vehicle was involved, or that<br />

each of the three persons was in two vehicles, which is impossible.<br />

• DUPLICATE specifies keyword WARN. The program displays a warning message and the<br />

first 80 characters of the second of the duplicate set of type 2 records. The first duplicate<br />

record is skipped, and only the second is included in the working data file. This assumes<br />

that no empty vehicles were involved in the accident.<br />

• If the duplicate record represents an empty vehicle, it can be included in the working data<br />

file by specifying keyword CASE on DUPLICATE. The program builds one case in the<br />

working data file for the first duplicate record, spreading information to that case from<br />

the previous type 1 record and assigning system-missing values to the variables defined<br />

for type 3 records. The second record from the duplicate set is used to build the three cases<br />

for the associated type 3 records.<br />

MISSING Subcommand<br />

MISSING determines whether the program issues a warning when it encounters a missing<br />

record type for a case. Regardless of whether the program issues the warning, it builds the<br />

case in the working file with system-missing values for the variables defined on the missing<br />

record. MISSING is optional for grouped and nested files.<br />

• MISSING cannot be used with mixed files and is optional for grouped and nested files.<br />

• For grouped and nested files, the program verifies that each defined case includes one<br />

record of each type.<br />

• The only specification is keyword WARN or NOWARN.

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

Saved successfully!

Ooh no, something went wrong!