Chapter 9: System and Portable File I/O
OUTFILE is the only required subcommand. Specify the system ﬁle to be written as a
string ﬁle name or a ﬁle handle (seeSection6.9[FileHandles],page44).
By default, cases excluded with FILTER are written to the system ﬁle. These can be
excluded by specifying DELETE on the UNSELECTED subcommand. Specifying RETAIN makes
the default explicit.
The UNCOMPRESSED, COMPRESSED, and ZCOMPRESSED subcommand determine the system
ﬁle’s compression level:
Data is not compressed. Each numeric value uses 8 bytes of disk space. Each
string value uses one byte per column width, rounded up to a multiple of 8
Data is compressed with a simple algorithm. Each integer numeric value be-
tween 99 and 151, inclusive, or system missing value uses one byte of disk
space. Each 8-byte segment of a string that consists only of spaces uses 1 byte.
Any other numeric value or 8-byte string segment uses 9 bytes of disk space.
Data is compressed with the “deﬂate” compression algorithm speciﬁed in
RFC 1951 (the same algorithm used by gzip). Files written with this
compression level cannot be read by PSPP 0.8.1 or earlier or by SPSS 20 or
COMPRESSED is the default compression level. The SET command (see Section 16.20
[SET], page 161)canchangethisdefault.
The PERMISSIONS subcommand speciﬁes permissions for the new system ﬁle. WRITE-
ABLE, the default, creates the ﬁle with read and write permission. READONLY creates
the ﬁle for read-only access.
By default, all the variables in the active dataset dictionary are written to the system
ﬁle. The DROP subcommand can be used to specify a list of variables not to be written. In
contrast, KEEP speciﬁes variables to be written, with all variables not speciﬁed not written.
Normally variables are saved to a system ﬁle under the same names they have in the
active dataset. Use the RENAME subcommand to change these names. Specify, within paren-
theses, a list of variable names followed by an equals sign (‘=’) and the names that they
should be renamed to. Multiple parenthesized groups of variable names can be included on
asingle RENAME subcommand. Variables’ names may be swapped using a RENAME subcom-
mand of the form /RENAME=(A B=B A).
Alternate syntax for the RENAME subcommand allows the parentheses to be eliminated.
When this is done, only a single variable may be renamed at once. For instance,
/RENAME=A=B. This alternate syntax is deprecated.
DROP, KEEP, and RENAME are performed in left-to-right order. They each may be present
any number of times. SAVE never modiﬁes the active dataset. DROP, KEEP, and RENAME only
aﬀect the system ﬁle written to disk.
The VERSION subcommand speciﬁes the version of the ﬁle format. Valid versions are 2
and 3. The default version is 3. In version 2 system ﬁles, variable names longer than 8
bytes will be truncated. The two versions are otherwise identical.