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.

Reading Past End of Record<br />

Example<br />

REPEATING DATA 1391<br />

If one or more fields extend past the end of the actual record, or if CONTINUED is specified<br />

and the ending column specified on either STARTS or CONTINUED is beyond the end of the<br />

actual record, the program takes the following action:<br />

• For string data with format A, the data record is considered to be extended logically with<br />

blanks. If the entire field lies past the end of the record, the resulting value will be all blanks.<br />

• For numeric data, a warning is issued and the resulting value is system-missing.<br />

* Build a file with each case representing one vehicle and<br />

spread information about the household to each case.<br />

INPUT PROGRAM.<br />

DATA LIST / SEQNUM 2-4 NUMPERS 6-7 NUMVEH 9-10.<br />

REPEATING DATA STARTS=12 /OCCURS=NUMVEH<br />

/DATA=MAKE 1-8 (A) MODEL 9 (A) NUMCYL 10.<br />

END INPUT PROGRAM.<br />

BEGIN DATA<br />

1001 02 02 FORD T8PONTIAC C6<br />

1002 04 01 CHEVY C4<br />

1003 02 03 CADILAC C8FORD T6VW C4<br />

END DATA.<br />

LIST.<br />

• Data are extracted from a file representing household records. Each input case is recorded<br />

on a single record; there are no continuation records.<br />

• The total number of persons living in the house and number of vehicles owned by the<br />

household is recorded on each record. The first field of numbers (columns 1–4) for each<br />

record is an identification number unique to each record. The next two fields of numbers<br />

are number of persons in household and number of vehicles. The remainder of the record<br />

contains repeating groups of information about each vehicle: the make of vehicle, model,<br />

and number of cylinders.<br />

• INPUT PROGRAM indicates the beginning of the input program and END INPUT PROGRAM<br />

indicates the end of the input program.<br />

• DATA LIST reads the variables from the household portion of the record. All fixed-format<br />

variables are defined on DATA LIST.<br />

• REPEATING DATA reads the information from the repeating groups and builds the output<br />

cases. Repeating groups start in column 12. The number of repeating groups for each<br />

input case is given by the value of variable NUMVEH. Three variables are defined for each<br />

repeating group: MAKE, MODEL, and NUMCYL.<br />

• The first input record contains two repeating groups, producing two output cases in the<br />

working data file. One output case is built from the second input record which contains<br />

information on one vehicle, and three output cases are built from the third record. The<br />

values of the fixed-format variables defined on DATA LIST are spread to every new case<br />

built in the working data file. Six cases result, as shown in Figure 1.

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

Saved successfully!

Ooh no, something went wrong!