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.

576 FILE TYPE—END FILE TYPE<br />

Example<br />

* A nested file of accident records.<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 />

• CASE specifies variable ACCID, located in columns 1–4, as the case identification variable.<br />

ACCID identifies the highest level of the hierarchy: the level for the accident records.<br />

• As each case is built, the value of the variable ACCID is checked against the value of ACCID<br />

on the last highest-level record (record type 1). If the values do not match, a warning<br />

message is issued. However, the record is used to build the case.<br />

• The data in this example contain only one value for ACCID, which is spread across all<br />

cases. In a nested file, the lowest-level record type determines the number of cases in the<br />

working data file. In this example, the working file has five cases because there are five<br />

person records.<br />

Example<br />

* Specifying case on the RECORD TYPE command.<br />

FILE TYPE GROUPED FILE=HUBDATA RECORD=#RECID 80 CASE=ID 1-5.<br />

RECORD TYPE 1.<br />

DATA LIST /MOHIRED YRHIRED 12-15 DEPT79 TO DEPT82 SEX 16-20.<br />

RECORD TYPE 2.<br />

DATA LIST /SALARY79 TO SALARY82 6-25 HOURLY81 HOURLY82 40-53 (2)<br />

PROMO81 72 AGE 54-55 RAISE82 66-70.<br />

RECORD TYPE 3 CASE=75-79.<br />

DATA LIST /JOBCAT 6 NAME 25-48 (A).<br />

END FILE TYPE.<br />

• The CASE subcommand on FILE TYPE indicates that the case identification number is<br />

located in columns 1–5. However, for type 3 records, the case identification number is<br />

located in columns 75–79. The CASE subcommand is therefore specified on the third<br />

RECORD TYPE command to override the case setting for type 3 records.

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

Saved successfully!

Ooh no, something went wrong!