4.4 Order of Commands
PSPP does not place many restrictions on ordering of commands. The
main restriction is that variables must be defined before they are otherwise
referenced. This section describes the details of command ordering,
but most users will have no need to refer to them.
PSPP possesses five internal states, called initial, INPUT PROGRAM,
FILE TYPE, transformation, and procedure states. (Please note the
distinction between the INPUT PROGRAM and FILE TYPE
commands and the INPUT PROGRAM and FILE TYPE states.)
PSPP starts in the initial state. Each successful completion
of a command may cause a state transition. Each type of command has its
own rules for state transitions:
- Utility commands
-
- Valid in any state.
- Do not cause state transitions. Exception: when N OF CASES
is executed in the procedure state, it causes a transition to the
transformation state.
- DATA LIST
-
- Valid in any state.
- When executed in the initial or procedure state, causes a transition to
the transformation state.
- Clears the active file if executed in the procedure or transformation
state.
- INPUT PROGRAM
-
- Invalid in INPUT PROGRAM and FILE TYPE states.
- Causes a transition to the INPUT PROGRAM state.
- Clears the active file.
- FILE TYPE
-
- Invalid in INPUT PROGRAM and FILE TYPE states.
- Causes a transition to the FILE TYPE state.
- Clears the active file.
- Other file definition commands
-
- Invalid in INPUT PROGRAM and FILE TYPE states.
- Cause a transition to the transformation state.
- Clear the active file, except for ADD FILES, MATCH FILES,
and UPDATE.
- Transformations
-
- Invalid in initial and FILE TYPE states.
- Cause a transition to the transformation state.
- Restricted transformations
-
- Invalid in initial, INPUT PROGRAM, and FILE TYPE states.
- Cause a transition to the transformation state.
- Procedures
-
- Invalid in initial, INPUT PROGRAM, and FILE TYPE states.
- Cause a transition to the procedure state.