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.

INPUT PROGRAM—END INPUT PROGRAM<br />

INPUT PROGRAM<br />

commands to create or define cases<br />

END INPUT PROGRAM<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 />

The INPUT PROGRAM and END INPUT PROGRAM commands enclose data definition and<br />

transformation commands that build cases from input records. The input program often<br />

encloses one or more DO IF—END IF or LOOP—END LOOP structures, and it must include at<br />

least one file definition command, such as DATA LIST. One of the following utility commands<br />

is also usually used:<br />

END CASE Build cases from the commands within the input program and pass<br />

the cases to the commands immediately following the input program.<br />

END FILE Terminate processing of a data file before the actual end of the file<br />

or define the end of the file when the input program is used to read<br />

raw data.<br />

REREAD Reread the current record using a different DATA LIST.<br />

REPEATING DATA Read repeating groups of data from the same input record.<br />

For more information on the commands used in an input program, see the discussion of each<br />

command.<br />

Input programs create a dictionary and data for a working file from raw data files; they<br />

cannot be used to read SPSS-format data files. They can be used to process direct-access<br />

and keyed data files. For details, see KEYED DATA LIST.<br />

Input Programs<br />

The program builds the working data file dictionary when it encounters commands that<br />

create and define variables. At the same time, the program builds an input program that constructs<br />

cases and an optional transformation program that modifies cases prior to analysis or<br />

display. By the time the program encounters a procedure command that tells it to read the<br />

777

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

Saved successfully!

Ooh no, something went wrong!