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.

END FILE<br />

END FILE<br />

Example<br />

INPUT PROGRAM.<br />

DATA LIST FILE=PRICES /YEAR 1-4 QUARTER 6 PRICE 8-12(2).<br />

DO IF (YEAR GE 1881). /*Stop reading before 1881<br />

END FILE.<br />

END IF.<br />

END INPUT PROGRAM.<br />

Overview<br />

END FILE is used in an INPUT PROGRAM—END INPUT PROGRAM structure to tell the<br />

program to stop reading data before it actually encounters the end of the file. END FILE<br />

can be used with END CASE to concatenate raw data files by causing the program to delay<br />

end-of-file processing until it has read multiple data files (see p. 422 for an example). END<br />

FILE can also be used with LOOP and END CASE to generate data without any data input<br />

(see p. 503 for an example).<br />

Basic Specification<br />

The basic specification is simply END FILE. There are no additional specifications. The end<br />

of file is defined according to the conditions specified for END FILE in the input program.<br />

<strong>Syntax</strong> Rules<br />

• END FILE is available only within an INPUT PROGRAM structure.<br />

• Only one END FILE command can be executed per input program. However, multiple<br />

END FILE commands can be specified within a conditional structure in the input<br />

program.<br />

Operations<br />

• When END FILE is encountered, the program stops reading data and puts an end of file<br />

in the working data file it was building. The case that causes the execution of END FILE<br />

is not read. To include this case, use the END CASE command before END FILE (see the<br />

examples below).<br />

• END FILE has the same effect as the end of the input data file. It terminates the input<br />

program (see INPUT PROGRAM—END INPUT PROGRAM).<br />

516

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

Saved successfully!

Ooh no, something went wrong!