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.

778 INPUT PROGRAM—END INPUT PROGRAM<br />

Input State<br />

data, the working file dictionary is ready, and the programs that construct and modify the cases<br />

in the working file are built.<br />

The internal input program is usually built from either a single DATA LIST command or<br />

from any of the commands that read or combine SPSS-format data files (for example, GET,<br />

ADD FILES, MATCH FILES, UPDATE, and so on). The input program can also be built from the<br />

FILE TYPE—END FILE TYPE structure used to define nested, mixed, or grouped files. The<br />

third type of input program is specified with the INPUT PROGRAM—END INPUT PROGRAM<br />

commands.<br />

With INPUT PROGRAM—END INPUT PROGRAM, you can create your own input program<br />

to perform many different operations on raw data. You can use transformation commands to<br />

build cases. You can read nonrectangular files, concatenate raw data files, and build cases<br />

selectively. You can also create a working data file without reading any data at all.<br />

There are four program states in the program: the initial state, in which there is no working<br />

file dictionary; the input state, in which cases are created from the input file; the transformation<br />

state, in which cases are transformed; and the procedure state, in which procedures are<br />

executed. When you specify INPUT PROGRAM—END INPUT PROGRAM, you must pay attention<br />

to which commands are allowed within the input state, which commands can appear only<br />

within the input state, and which are not allowed within the input state. See Appendix A for a<br />

discussion of program states, command order, and a table that describes what happens to each<br />

command when it is encountered in each of the four states.<br />

Basic Specification<br />

The basic specification is INPUT PROGRAM, the commands used to create cases and define<br />

the working data file, and END INPUT PROGRAM.<br />

• INPUT PROGRAM and END INPUT PROGRAM each must be specified on a separate line<br />

and have no additional specifications.<br />

• To define a working data file, the input program must include at least one DATA LIST or<br />

END FILE command.<br />

Operations<br />

• The INPUT PROGRAM—END INPUT PROGRAM structure defines a working data file and<br />

is not executed until the program encounters a procedure or the EXECUTE command.<br />

• INPUT PROGRAM clears the current working data file.

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

Saved successfully!

Ooh no, something went wrong!