Syntax Rules

When you run commands from a command syntax window during a session, you are running commands in interactive mode.

The following rules apply to command specifications in interactive mode:

  • Each command must start on a new line. Commands can begin in any column of a command line and continue for as many lines as needed. The exception is the END DATA command, which must begin in the first column of the first line after the end of data.
  • Each command should end with a period as a command terminator. It is best to omit the terminator on BEGIN DATA, however, so that inline data are treated as one continuous specification.
  • The command terminator must be the last nonblank character in a command.
  • In the absence of a period as the command terminator, a blank line is interpreted as a command terminator.

Note: For compatibility with other modes of command execution (including command files run with INSERT or INCLUDE commands in an interactive session), each line of command syntax should not exceed 256 characters.

  • Most subcommands are separated by slashes (/). The slash before the first subcommand on a command is usually optional.
  • Variable names must be spelled out fully.
  • Text included within apostrophes or quotation marks must be contained on a single line.
  • A period (.) must be used to indicate decimals, regardless of your regional or locale settings.
  • Variable names ending in a period can cause errors in commands created by the dialog boxes. You cannot create such variable names in the dialog boxes, and you should generally avoid them.

Command syntax is case insensitive, and three- or four-letter abbreviations can be used for many command specifications. You can use as many lines as you want to specify a single command. You can add space or break lines at almost any point where a single blank is allowed, such as around slashes, parentheses, arithmetic operators, or between variable names. For example,

  /PERCENTILES=25 50 75


freq var=jobcat gender /percent=25 50 75 /bar.

are both acceptable alternatives that generate the same results.


For command files run via the INCLUDE command, batch mode syntax rules apply.

The following rules apply to command specifications in batch mode:

  • All commands in the command file must begin in column 1. You can use plus (+) or minus (–) signs in the first column if you want to indent the command specification to make the command file more readable.
  • If multiple lines are used for a command, column 1 of each continuation line must be blank.
  • Command terminators are optional.
  • A line cannot exceed 256 characters; any additional characters are truncated.

Unless you have existing command files that already use the INCLUDE command, you should probably use the INSERT command instead, since it can accommodate command files that conform to either set of rules. If you generate command syntax by pasting dialog box choices into a syntax window, the format of the commands is suitable for any mode of operation. See the Command Syntax Reference (available in PDF format from the Help menu) for more information.