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.

1400 REPEATING DATA<br />

in positions 1–20 of each repeating group, followed by a blank. Thus, each repeating<br />

group is 21 columns wide. The length of the first record of each input case is therefore 51<br />

columns: 21 columns for each of two repeating groups, plus the eight columns defined on<br />

DATA LIST, plus column 9, which is blank. The operating system’s logical record length<br />

is 80, which allows room for one more repeating group on the first record of each input<br />

case. STARTS must therefore specify an ending column that does not provide enough<br />

columns for another repeating group; otherwise, the program creates an output case with<br />

missing values for the variables specified on DATA.<br />

• STARTS specifies that the program is to scan only columns 10–55 of the first record of<br />

each input case looking for repeating data groups. It will scan continuation records beginning<br />

in column 7 until the value specified on the OCCURS subcommand is reached.<br />

Example<br />

* Specifying an ending column on the CONTINUED subcommand.<br />

* This example assumes the logical record length is 80.<br />

INPUT PROGRAM.<br />

DATA LIST / ORDERID 1-5 NITEMS 7-8.<br />

REPEATING DATA STARTS=10-55 /OCCURS=NITEMS /CONTINUED=7-55<br />

/DATA=ITEM 1-9 (A) QUANTITY 11-13 PRICE (DOLLAR7.2,1X).<br />

END INPUT PROGRAM.<br />

BEGIN DATA<br />

10020 07 01-923-89 001 25.99 02-899-56 100 101.99<br />

10020 03-574-54 064 61.29 04-780-32 025 13.95<br />

10020 05-756-90 005 56.75 06-323-47 003 23.74<br />

10020 07-350-95 014 11.46<br />

20030 04 01-781-43 010 10.97 89-236-54 075 105.95<br />

20030 03-655-83 054<br />

END DATA.<br />

LIST.<br />

22.99 04-569-38 015 75.00<br />

• The data are the same as in the previous two examples, but records are entered differently.<br />

The first record and the continuation records for each input case store only two repeating<br />

groups each.<br />

• The operating system’s logical record length is 80, which allows room for more repeating<br />

groups on all records.<br />

• STARTS specifies that the program is to scan only columns 10-55 of the first record of<br />

each input case looking for repeating data groups.<br />

• CONTINUED specifies that the program is to scan only columns 7–55 of all continuation<br />

records.<br />

ID Subcommand<br />

ID compares the value of an identification variable across records of the same input case. ID<br />

can be used only when CONTINUED is specified. The identification variable must be defined<br />

on a DATA LIST command and must be recorded on all records in the file.

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

Saved successfully!

Ooh no, something went wrong!