Overview (SAVE CODEPAGE command)
In Unicode mode, SAVE CODEPAGE produces a data file in the specified locale
character encoding.
Options
Encoding. You can use the ENCODING subcommand to specify the character
encoding.
Variable Subsets and Order. You can use the DROP and
KEEP subcommands to save a subset of variables and reorder the variables that
are saved.
Filtered Cases. If filtering is in effect, you can use the UNSELECTED
subcommand to specify inclusion or exclusion of filtered cases. By default, all cases are
included.
Encryption. You can use the PASSPROTECT subcommand to save the file as
encrypted, allowing you to protect confidential information stored in the file.
Basic specification
The basic specification is the OUTFILE subcommand, which specifies a name for
the data file to be saved.
Syntax rules
-
OUTFILEis required. All other subcommands are optional. -
KEEPandDROPcan each be used as many times as needed. ENCODING,UNSELECTED, andPASSPROTECTcan each be used only once.
Operations
-
SAVE CODEPAGEis executed immediately and causes the data to be read. - The new data file dictionary is arranged in the same order as the active dataset dictionary,
unless variables are reordered with the
KEEPsubcommand. - New variables that were created by transformations and procedures that occurred prior to the
SAVE CODEPAGEcommand are included in the new data file, and variables that were altered by transformations are saved in their modified form. Results of any temporary transformations that immediately precede theSAVE CODEPAGEcommand are included in the file; scratch variables are not included. - The active dataset is not changed by
SAVE CODEPAGE. The file encoding specified onSAVE CODEPAGEdoes not affect the active dataset.SAVE CODEPAGEoperates in a manner similar to commands that create data files in external formats, such asWRITEandSAVE TRANSLATE.
Limitations
SAVE CODEPAGEis only available in Unicode mode. An error occurs if you use this command in code page mode. For more information on Unicode and code page mode, see theSETcommand,UNICODEsubcommand.