Overview (INPUT PROGRAM-END INPUT PROGRAM command)
The INPUT PROGRAM
and END INPUT PROGRAM
commands
enclose data definition and transformation commands that build cases
from input records. The input program often encloses one or more DO IF-END IF
or LOOP-END LOOP
structures, and it must include at least
one file definition command, such as DATA
LIST
. One of the following utility commands is also usually
used:
END CASE. Build cases from the commands within the input program and pass the cases to the commands immediately following the input program.
END FILE. Terminate processing of a data file before the actual end of the file or define the end of the file when the input program is used to read raw data.
REREAD. Reread the
current record using a different DATA LIST
.
REPEATING DATA. Read repeating groups of data from the same input record.
For more information on the commands used in an input program, see the discussion of each command.
Input programs create a dictionary and data for an
active dataset from raw data files; they cannot be used to read IBM® SPSS® Statistics data files. They can be used to process
direct-access and keyed data files. For details, see KEYED DATA LIST
.
Basic Specification
The basic specification is INPUT PROGRAM
, the commands used to create cases and define the active dataset,
and END INPUT PROGRAM
.
-
INPUT PROGRAM
andEND INPUT PROGRAM
each must be specified on a separate line and have no additional specifications. - To define an active dataset, the input program must
include at least one
DATA LIST
orEND FILE
command.
Operations
- The
INPUT PROGRAM-END INPUT PROGRAM
structure defines an active dataset and is not executed until the program encounters a procedure or theEXECUTE
command. -
INPUT PROGRAM
clears the current active dataset.