Overview (OUTPUT OPEN command)

The OUTPUT commands (OUTPUT NEW, OUTPUT NAME, OUTPUT ACTIVATE, OUTPUT OPEN, OUTPUT SAVE, OUTPUT CLOSE) provide the ability to programmatically manage one or many output documents. These functions allow you to:

  • Save an output document through syntax.
  • Programmatically partition output into separate output documents (for example, results for males in one output document and results for females in a separate one).
  • Work with multiple open output documents in a given session, selectively appending new results to the appropriate document.

The OUTPUT OPEN command opens a Viewer document, which becomes the designated output document. You can use OUTPUT OPEN to append output to an existing output document. Once opened, subsequent procedure output is directed to the document until it is closed or until another output document is created, opened, or activated.

Basic Specification

The basic specification for OUTPUT OPEN is the command name followed by a file specification for the file to open.

NAME Keyword

By default, the newly opened output document is provided with a unique name. You can optionally specify a custom name for the output document, overriding the default name. The document name is used to reference the document in any subsequent OUTPUT ACTIVATE, OUTPUT SAVE, and OUTPUT CLOSE commands.

  • The specified name must conform to variable naming rules. See the topic Variable Names for more information.
  • If the specified name is associated with another document, that association is broken and the name is associated with the newly opened document. The document previously associated with the specified name is assigned a new unique name.

LOCK Keyword

The LOCK keyword only applies when opening a file from a IBM® SPSS® Collaboration and Deployment Services Repository. It specifies whether the file is locked (in the repository) when opened. Locking a file prevents other users from modifying it while you are working with it. Other users can open locked files but they cannot save them back to the repository. The lock is released when the file is closed or when the current session ends.

  • By default, files are opened as locked.
  • The LOCK keyword is ignored if the specified file does not reside in a IBM SPSS Collaboration and Deployment Services Repository.

See the topic File Specifications for IBM SPSS Collaboration and Deployment Services Repository Objects for more information.

PASSWORD Keyword

The PASSWORD keyword specifies the password required to open an encrypted IBM SPSS Statistics output file. The specified value must be enclosed in quotation marks and can be provided as encrypted or as plain text. Encrypted passwords are created when pasting command syntax from the Save Output As dialog. The PASSWORD keyword is ignored if the file is not encrypted.

Syntax Rules

  • An error occurs if a keyword is specified more than once.
  • Keywords must be spelled in full.
  • Equals signs (=) used in the syntax chart are required elements.

Operations

  • The output document is opened in a window in the user interface and becomes the designated output window.
  • An error occurs, but processing continues, if the specified file is not found. Output continues to be directed to the last designated output document.
  • An error occurs, but processing continues, if the specified file is not a Viewer document. Output continues to be directed to the last designated output document.
  • OUTPUT OPEN honors file handles and changes to the working directory made with the CD command.

Limitations

  • Because each window requires a minimum amount of memory, there is a limit to the number of windows, IBM SPSS Statistics or otherwise, that can be concurrently open on a given system. The particular number depends on the specifications of your system and may be independent of total memory due to OS constraints.
  • OUTPUT OPEN is not supported in the IBM SPSS Statistics Batch Facility (available with IBM SPSS Statistics Server).

Example

OUTPUT OPEN FILE='/examples/output/Q1Output.spv'.
GET FILE='/examples/data/March.sav'.
FREQUENCIES VARIABLES=ALL.
OUTPUT SAVE OUTFILE='/examples/output/Q1Output.spv'.
  • OUTPUT OPEN opens the Viewer document /examples/output/Q1Output.spv. The document contains summaries for the months of January and February.
  • The GET command opens a file containing data for the month of March.
  • The FREQUENCIES command produces summaries for March data, which are appended to the designated output document.
  • OUTPUT SAVE saves the designated output document to /examples/output/Q1Output.spv. The saved document contains results for each of the three months in the first quarter.