Overview (OUTPUT SAVE 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 SAVE
command saves
the contents of an open output document to a file.
Basic specification
The basic specification for OUTPUT SAVE
is the command name
followed by a file specification for the destination file.
NAME keyword
Use the NAME
keyword to save an output document other than
the designated one. Provide the name associated with the document.
TYPE keyword
Use the TYPE
keyword to specify the format of the output
file--SPV
for standard output files.
LOCK keyword
Use LOCK=YES
to prevent editing of Viewer documents in IBM® SPSS® Smartreader (a separate product for
working with Viewer documents). If a Viewer document is locked, you can manipulate pivot tables
(swap rows and columns, change the displayed layer, etc.) but you cannot edit any output or save any
changes to the Viewer document in IBM SPSS Smartreader. This setting has no effect
on Viewer documents opened in IBM SPSS Statistics. The default is
LOCK=NO
.
STOREMODEL keyword
The STOREMODEL
keyword applies only when there are model
viewer items in the output document that require auxiliary information to enable some of the
interactive features. The default is STOREMODEL=YES
, which specifies to store the
auxiliary information with the output document. Storing this information with the output document
might substantially increase the document size. If you choose not to store this information, you can
still open these output items but the specified interactive features will not be available. You can
view the affected model viewer items and interactive features by clicking More
Info on the Save Output As dialog.
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
- By default, the designated output document is saved. The designated output
document is the one most recently opened (by
OUTPUT NEW
orOUTPUT OPEN
) or activated (byOUTPUT ACTIVATE
). - If the specified file already exists,
OUTPUT SAVE
overwrites it without warning. - An error occurs if you specify a nonexistent output document.
- An error occurs if the file specification is invalid.
-
OUTPUT SAVE
saves the document but does not close it. UseOUTPUT CLOSE
to close the document. -
OUTPUT SAVE
honors file handles and changes to the working directory made with theCD
command.
Limitations
-
OUTPUT SAVE
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. -
GET
opens a file containing new data for March. -
FREQUENCIES
produces frequencies for March data, which are appended to the designated output document. -
OUTPUT SAVE
saves the contents of the designated output document to /examples/output/Q1Output.spv, which now contains results for the entire first quarter.