Overview (INCLUDE command)
INCLUDE
includes
a file of commands in a session. INCLUDE
is especially useful for including a long series of data definition
statements or transformations. Another use for INCLUDE
is to set up a library of commonly used commands
and include them in the command sequence as they are needed.
Note:
The newer INSERT
provides equivalent
functionality, plus additional features not available with INCLUDE
. See the topic INSERT for more information.
INCLUDE
allows you to run multiple commands together during a session and
can save time. Complex or repetitive commands can be stored in a command
file and included in the session, while simpler commands or commands
unique to the current analysis can be entered during the session,
before and after the included file.
Basic Specification
The only
specification is the FILE
subcommand,
which specifies the file to include. When INCLUDE
is executed, the commands in the specified file
are processed.
Syntax Rules
- Commands in an included file must begin in column 1, and continuation lines for each command must be indented at least one column.
- The maximum line length for a command syntax file run
via the
INCLUDE
command is 256 characters. Any characters beyond this limit are truncated. - As many
INCLUDE
commands as needed can be used in a session. -
INCLUDE
commands can be nested so that one set of included commands includes another set of commands. This nesting can go to five levels. However, a file cannot be included that is still open from a previous step.
Operations
- If an included
file contains a
FINISH
command, the session ends and no further commands are processed. - If a journal file is created for the session,
INCLUDE
is copied to the journal file. Commands from the included file are also copied to the journal file but are treated like printed messages. Thus,INCLUDE
can be executed from the journal file if the journal file is later used as a command file. Commands from the included file are executed only once.