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.

REREAD<br />

REREAD [FILE=file]<br />

[COLUMN=expression]<br />

Example<br />

INPUT PROGRAM.<br />

DATA LIST /KIND 10-14 (A).<br />

DO IF (KIND EQ ’FORD’).<br />

REREAD.<br />

DATA LIST /PARTNO 1-2 PRICE 3-6 (DOLLAR,2) QUANTITY 7-9.<br />

END CASE.<br />

ELSE IF (KIND EQ ’CHEVY’).<br />

REREAD.<br />

DATA LIST /PARTNO 1-2 PRICE 15-18 (DOLLAR,2) QUANTITY 19-21.<br />

END CASE.<br />

END IF.<br />

END INPUT PROGRAM.<br />

BEGIN DATA<br />

111295100FORD<br />

11 CHEVY 295015<br />

END DATA.<br />

Overview<br />

Options<br />

REREAD instructs the program to reread a record in the data. It is available only within an<br />

INPUT PROGRAM structure and is generally used to define data using information obtained<br />

from a previous reading of the record. REREAD is usually specified within a conditional<br />

structure, such as DO IF—END IF, and is followed by a DATA LIST command. When it<br />

receives control for a case, REREAD places the pointer back to the column specified for the<br />

current case and begins reading data as defined by the DATA LIST command that follows.<br />

Data Source. You can use inline data or data from an external file specified on the FILE<br />

subcommand. Using external files allows you to open multiple files and merge data.<br />

Beginning Column. You can specify a beginning column other than column 1 using the<br />

COLUMN subcommand.<br />

Basic Specification<br />

The basic specification is the command keyword REREAD. The program rereads the<br />

current case according to the data definitions specified on the following DATA LIST.<br />

1431

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

Saved successfully!

Ooh no, something went wrong!