Syntax Rules and Guidelines
All of the procedures that are currently available in IBM® SPSS® Statistics Server are available in the Batch Facility. See the IBM SPSS Statistics Command Syntax Reference (on the product DVD) for a complete listing of commands. If you've used an earlier version, be aware that some procedures and commands might have changed.
This section provides an overview of the IBM SPSS Statistics command syntax. For detailed information about syntax and complete syntax specifications for specific commands, see the IBM SPSS Statistics Command Syntax Reference (on the product DVD).
A command syntax file is simply a text file that contains commands. Commands are the instructions that you give the program to initiate an action. Each command begins with a command keyword (which may contain more than one word). The command keyword is followed by at least one blank space and then any additional specifications.
Interactive syntax rules. When you run the Batch Facility in interactive mode, the syntax must follow these rules:
- Commands must end with a command terminator--a period.
- Subcommands are usually separated by forward slashes (/).
- Variable names must be completely spelled out.
Batch syntax rules. By default, when you run the Batch Facility in batch mode, the following rules apply in addition to the rules listed above:
- Each command must begin in the first column of a new line.
- The command terminator (.) is optional.
- Continuation lines must be indented at least one space.
Although batch syntax rules are the default when running the Batch Facility in batch mode, there is a command line switch that allows you to enforce interactive syntax rules. See the topic Syntax Rules for more information.
The following is an example of the contents of a command syntax file, suitable for batch mode.
GET
FILE='Employee data.sav'.
CORRELATIONS
/VARIABLES=salary prevexp
/PRINT=TWOTAIL NOSIG
/MISSING=PAIRWISE.
Additional syntax guidelines. Consider the following points when you are creating or editing command syntax files:
- Command syntax is not case sensitive (note that filenames enclosed in quotes are case sensitive if the file system is case sensitive).
- You can use as many lines as you want to specify a command.
- You can add extra spaces or break lines at almost any point where a single space is allowed; for example, around slashes, parentheses, arithmetic operators, or between variable names.