Overview (XSAVE command)
XSAVE produces IBM® SPSS® Statistics data files. IBM SPSS Statistics data files contain data plus a dictionary.
The dictionary contains a name for each variable in the data file
plus any assigned variable and value labels, missing-value flags,
and variable print and write formats. The dictionary also contains
document text created with the DOCUMENTS command.
SAVE also creates IBM SPSS Statistics data files. The principal difference
is that XSAVE is not executed
until data are read for the next procedure, while SAVE is executed by itself. Thus, XSAVE can reduce processing time by consolidating
two data passes into one.
See SAVE TRANSLATE for information on saving data files that can be used by other programs.
Options
Variable Subsets and Order. You can save
a subset of variables and reorder the variables that are saved using
the DROP and KEEP subcommands.
Variable Names. You can
rename variables as they are copied into the data file using the RENAME subcommand.
Variable Map. To confirm
the names and order of the variables saved in the data file, use the MAP subcommand. MAP displays the variables saved in the data file next
to their corresponding names in the active dataset.
Data Compression. You can use the COMPRESSED or ZCOMPRESSED subcommand to write the data
file in compressed form. You can use the UNCOMPRESSED subcommand to write the data file in an
uncompressed form. See the topic COMPRESSED, UNCOMPRESSED, and ZCOMPRESSED Subcommands (XSAVE command) for more information.
Basic Specification
The basic
specification is the OUTFILE subcommand,
which specifies a name for the data file to be saved.
Subcommand Order
- Subcommands can be specified in any order.
Syntax Rules
-
OUTFILEis required and can be specified only once. IfOUTFILEis specified more than once, only the lastOUTFILEspecification is in effect. -
KEEP,DROP,RENAME, andMAPcan be used as many times as needed. - Only one of the subcommands
COMPRESSED,UNCOMPRESSED, orZCOMPRESSEDcan be specified perXSAVEcommand. - Documentary text can be dropped from the active dataset
with the
DROP DOCUMENTScommand. -
XSAVEcannot appear within aDO REPEAT—END REPEATstructure. - Multiple
XSAVEcommands writing to the same file are not permitted.
Operations
- Unlike the
SAVEcommand,XSAVEis a transformation command and is executed when the data are read for the next procedure. - The new data file dictionary
is arranged in the same order as the active dataset dictionary unless
variables are reordered with the
KEEPsubcommand. Documentary text from the active dataset dictionary is always saved unless it is dropped with theDROP DOCUMENTScommand beforeXSAVE. - New variables created by transformations
and procedures previous to the
XSAVEcommand are included in the new data file, and variables altered by transformations are saved in their modified form. Results of any temporary transformations immediately preceding theXSAVEcommand are included in the file; scratch variables are not. - IBM SPSS Statistics data files are binary files designed to be read and written by IBM SPSS Statistics only.
- The active dataset is still available
for transformations and procedures after
XSAVEis executed. -
XSAVEprocesses the dictionary first and displays a message that indicates how many variables will be saved. Once the data are written,XSAVEindicates how many cases were saved. If the second message does not appear, the file was probably not completely written.
Limitations
- Maximum of 64
XSAVEcommands are allowed within a single set of transformations.