work on PRINT encoding
[pspp] / doc / data-io.texi
index 93f071568f98ac023b80b70ddea9a93fb76c4f45..142c725b203be62e459680aa33f7a301218eb263 100644 (file)
@@ -1,4 +1,9 @@
-@node Data Input and Output, System and Portable Files, Expressions, Top
+@c (modify-syntax-entry ?_ "w")
+@c (modify-syntax-entry ?' "'")
+@c (modify-syntax-entry ?@ "'")
+
+
+@node Data Input and Output
 @chapter Data Input and Output
 @cindex input
 @cindex output
 @cindex cases
 @cindex observations
 
-Data are the focus of the PSPP language.  
+Data are the focus of the @pspp{} language.  
 Each datum  belongs to a @dfn{case} (also called an @dfn{observation}).
 Each case represents an individual or ``experimental unit''.
 For example, in the results of a survey, the names of the respondents,
 their sex, age, etc.@: and their responses are all data and the data
 pertaining to single respondent is a case.
 This chapter examines
-the PSPP commands for defining variables and reading and writing data.
+the @pspp{} commands for defining variables and reading and writing data.
+There are alternative commands to  read data from predefined sources
+such as system files or databases (@xref{GET, GET DATA}.)
 
 @quotation Note
-These commands tell PSPP how to read data, but the data will not
+These commands tell @pspp{} how to read data, but the data will not
 actually be read until a procedure is executed.
 @end quotation
 
 @menu
 * BEGIN DATA::                  Embed data within a syntax file.
-* CLEAR TRANSFORMATIONS::       Clear pending transformations.
 * CLOSE FILE HANDLE::           Close a file handle.
+* DATAFILE ATTRIBUTE::          Set custom attributes on data files.
+* DATASET::                     Manage multiple datasets.
 * DATA LIST::                   Fundamental data reading command.
 * END CASE::                    Output the current case.
 * END FILE::                    Terminate the current input program.
 * FILE HANDLE::                 Support for special file formats.
 * INPUT PROGRAM::               Support for complex input programs.
-* LIST::                        List cases in the active file.
-* MATRIX DATA::                 Read matrices in text format.
-* NEW FILE::                    Clear the active file and dictionary.
+* LIST::                        List cases in the active dataset.
+* NEW FILE::                    Clear the active dataset.
 * PRINT::                       Display values in print formats.
 * PRINT EJECT::                 Eject the current page then print.
 * PRINT SPACE::                 Print blank lines.
@@ -54,7 +61,7 @@ END DATA.
 @end display
 
 @cmd{BEGIN DATA} and @cmd{END DATA} can be used to embed raw ASCII
-data in a PSPP syntax file.  @cmd{DATA LIST} or another input
+data in a @pspp{} syntax file.  @cmd{DATA LIST} or another input
 procedure must be used before @cmd{BEGIN DATA} (@pxref{DATA LIST}).
 @cmd{BEGIN DATA} and @cmd{END DATA} must be used together.  @cmd{END
 DATA} must appear by itself on a single line, with no leading
@@ -65,22 +72,11 @@ white space and exactly one space between the words @code{END} and
 END DATA.
 @end example
 
-@node CLEAR TRANSFORMATIONS
-@section CLEAR TRANSFORMATIONS
-@vindex CLEAR TRANSFORMATIONS
-
-@display
-CLEAR TRANSFORMATIONS.
-@end display
-
-@cmd{CLEAR TRANSFORMATIONS} clears out all pending
-transformations.  It does not cancel the current input program.
-
 @node CLOSE FILE HANDLE
 @section CLOSE FILE HANDLE
 
 @display
-CLOSE FILE HANDLE handle_name.
+CLOSE FILE HANDLE @var{handle_name}.
 @end display
 
 @cmd{CLOSE FILE HANDLE} disassociates the name of a file handle with a
@@ -88,17 +84,136 @@ given file.  The only specification is the name of the handle to close.
 Afterward
 @cmd{FILE HANDLE}.
 
-If the file handle name refers to a scratch file, then the storage
-associated with the scratch file in memory or on disk will be freed.
-If the scratch file is in use, e.g.@: it has been specified on a
-@cmd{GET} command whose execution has not completed, then freeing is
-delayed until it is no longer in use.
-
 The file named INLINE, which represents data entered between @cmd{BEGIN
 DATA} and @cmd{END DATA}, cannot be closed.  Attempts to close it with
 @cmd{CLOSE FILE HANDLE} have no effect.
 
-@cmd{CLOSE FILE HANDLE} is a PSPP extension.
+@cmd{CLOSE FILE HANDLE} is a @pspp{} extension.
+
+@node DATAFILE ATTRIBUTE
+@section DATAFILE ATTRIBUTE
+@vindex DATAFILE ATTRIBUTE
+
+@display
+DATAFILE ATTRIBUTE
+         ATTRIBUTE=@var{name}('@var{value}') [@var{name}('@var{value}')]@dots{}
+         ATTRIBUTE=@var{name}@b{[}@var{index}@b{]}('@var{value}') [@var{name}@b{[}@var{index}@b{]}('@var{value}')]@dots{}
+         DELETE=@var{name} [@var{name}]@dots{}
+         DELETE=@var{name}@b{[}@var{index}@b{]} [@var{name}@b{[}@var{index}@b{]}]@dots{}
+@end display
+
+@cmd{DATAFILE ATTRIBUTE} adds, modifies, or removes user-defined
+attributes associated with the active dataset.  Custom data file
+attributes are not interpreted by @pspp{}, but they are saved as part of
+system files and may be used by other software that reads them.
+
+Use the @subcmd{ATTRIBUTE} subcommand to add or modify a custom data file
+attribute.  Specify the name of the attribute as an identifier
+(@pxref{Tokens}), followed by the desired value, in parentheses, as a
+quoted string.  Attribute names that begin with @code{$} are reserved
+for @pspp{}'s internal use, and attribute names that begin with @code{@@}
+or @code{$@@} are not displayed by most @pspp{} commands that display
+other attributes.  Other attribute names are not treated specially.
+
+Attributes may also be organized into arrays.  To assign to an array
+element, add an integer array index enclosed in square brackets
+(@code{[} and @code{]}) between the attribute name and value.  Array
+indexes start at 1, not 0.  An attribute array that has a single
+element (number 1) is not distinguished from a non-array attribute.
+
+Use the @subcmd{DELETE} subcommand to delete an attribute.  Specify an
+attribute name by itself to delete an entire attribute, including all
+array elements for attribute arrays.  Specify an attribute name
+followed by an array index in square brackets to delete a single
+element of an attribute array.  In the latter case, all the array
+elements numbered higher than the deleted element are shifted down,
+filling the vacated position.
+
+To associate custom attributes with particular variables, instead of
+with the entire active dataset, use @cmd{VARIABLE ATTRIBUTE}
+(@pxref{VARIABLE ATTRIBUTE}) instead.
+
+@cmd{DATAFILE ATTRIBUTE} takes effect immediately.  It is not affected
+by conditional and looping structures such as @cmd{DO IF} or
+@cmd{LOOP}.
+
+@node DATASET
+@section DATASET commands
+@vindex DATASET
+
+@display
+DATASET NAME @var{name} [WINDOW=@{ASIS,FRONT@}].
+DATASET ACTIVATE @var{name} [WINDOW=@{ASIS,FRONT@}].
+DATASET COPY @var{name} [WINDOW=@{MINIMIZED,HIDDEN,FRONT@}].
+DATASET DECLARE @var{name} [WINDOW=@{MINIMIZED,HIDDEN,FRONT@}].
+DATASET CLOSE @{@var{name},*,ALL@}.
+DATASET DISPLAY.
+@end display
+
+The @cmd{DATASET} commands simplify use of multiple datasets within a
+@pspp{} session.  They allow datasets to be created and destroyed.  At
+any given time, most @pspp{} commands work with a single dataset, called
+the active dataset.
+
+@vindex DATASET NAME
+The DATASET NAME command gives the active dataset the specified name, or
+if it already had a name, it renames it.  If another dataset already
+had the given name, that dataset is deleted.
+
+@vindex DATASET ACTIVATE
+The DATASET ACTIVATE command selects the named dataset, which must
+already exist, as the active dataset.  Before switching the active
+dataset, any pending transformations are executed, as if @cmd{EXECUTE}
+had been specified.  If the active dataset is unnamed before
+switching, then it is deleted and becomes unavailable after switching.
+
+@vindex DATASET COPY
+The DATASET COPY command creates a new dataset with the specified
+name, whose contents are a copy of the active dataset.  Any pending
+transformations are executed, as if @cmd{EXECUTE} had been specified,
+before making the copy.  If a dataset with the given name already
+exists, it is replaced.  If the name is the name of the active
+dataset, then the active dataset becomes unnamed.
+
+@vindex DATASET DECLARE
+The DATASET DECLARE command creates a new dataset that is initially
+``empty,'' that is, it has no dictionary or data.  If a dataset with
+the given name already exists, this has no effect.  The new dataset
+can be used with commands that support output to a dataset,
+e.g. AGGREGATE (@pxref{AGGREGATE}).
+
+@vindex DATASET CLOSE
+The DATASET CLOSE command deletes a dataset.  If the active dataset is
+specified by name, or if @samp{*} is specified, then the active
+dataset becomes unnamed.  If a different dataset is specified by name,
+then it is deleted and becomes unavailable.  Specifying ALL deletes
+all datasets except for the active dataset, which becomes unnamed.
+
+@vindex DATASET DISPLAY
+The DATASET DISPLAY command lists all the currently defined datasets.
+
+Many DATASET commands accept an optional @subcmd{WINDOW} subcommand.  In the
+@pspp{}IRE GUI, the value given for this subcommand influences how the
+dataset's window is displayed.  Outside the GUI, the @subcmd{WINDOW} subcommand
+has no effect.  The valid values are:
+
+@table @asis
+@item ASIS
+Do not change how the window is displayed.  This is the default for
+DATASET NAME and DATASET ACTIVATE.
+
+@item FRONT
+Raise the dataset's window to the top.  Make it the default dataset
+for running syntax.
+
+@item MINIMIZED
+Display the window ``minimized'' to an icon.  Prefer other datasets
+for running syntax.  This is the default for DATASET COPY and DATASET
+DECLARE.
+
+@item HIDDEN
+Hide the dataset's window.  Prefer other datasets for running syntax.
+@end table
 
 @node DATA LIST
 @section DATA LIST
@@ -112,7 +227,7 @@ Used to read text or binary data, @cmd{DATA LIST} is the most
 fundamental data-reading command.  Even the more sophisticated input
 methods use @cmd{DATA LIST} commands as a building block.
 Understanding @cmd{DATA LIST} is important to understanding how to use
-PSPP to read your data files.
+@pspp{} to read your data files.
 
 There are two major variants of @cmd{DATA LIST}, which are fixed
 format and free format.  In addition, free format has a minor variant,
@@ -121,6 +236,10 @@ free format.
 
 Each form of @cmd{DATA LIST} is described in detail below.
 
+@xref{GET DATA}, for a command that offers a few enhancements over
+DATA LIST and that may be substituted for DATA LIST in many
+situations.
+
 @menu
 * DATA LIST FIXED::             Fixed columnar locations for data.
 * DATA LIST FREE::              Any spacing you like.
@@ -138,37 +257,46 @@ Each form of @cmd{DATA LIST} is described in detail below.
 @display
 DATA LIST [FIXED]
         @{TABLE,NOTABLE@}
-        FILE='filename'
-        RECORDS=record_count
-        END=end_var
-        /[line_no] var_spec@dots{}
-
-where each var_spec takes one of the forms
-        var_list start-end [type_spec]
-        var_list (fortran_spec)
+        [FILE='@var{file_name}' [ENCODING='@var{encoding}']]
+        [RECORDS=@var{record_count}]
+        [END=@var{end_var}]
+        [SKIP=@var{record_count}]
+        /[line_no] @var{var_spec}@dots{}
+
+where each @var{var_spec} takes one of the forms
+        @var{var_list} @var{start}-@var{end} [@var{type_spec}]
+        @var{var_list} (@var{fortran_spec})
 @end display
 
 @cmd{DATA LIST FIXED} is used to read data files that have values at fixed
 positions on each line of single-line or multiline records.  The
 keyword FIXED is optional.
 
-The FILE subcommand must be used if input is to be taken from an
-external file.  It may be used to specify a filename as a string or a
-file handle (@pxref{File Handles}).  If the FILE subcommand is not used,
+The @subcmd{FILE} subcommand must be used if input is to be taken from an
+external file.  It may be used to specify a file name as a string or a
+file handle (@pxref{File Handles}).  If the @subcmd{FILE} subcommand is not used,
 then input is assumed to be specified within the command file using
 @cmd{BEGIN DATA}@dots{}@cmd{END DATA} (@pxref{BEGIN DATA}).
+The @subcmd{ENCODING} subcommand may only be used if the @subcmd{FILE}
+subcommand is also used.  It specifies the character encoding of the
+file.  @xref{INSERT}, for information on supported encodings.
 
-The optional RECORDS subcommand, which takes a single integer as an
-argument, is used to specify the number of lines per record.  If RECORDS
+The optional @subcmd{RECORDS} subcommand, which takes a single integer as an
+argument, is used to specify the number of lines per record.
+If @subcmd{RECORDS}
 is not specified, then the number of lines per record is calculated from
 the list of variable specifications later in @cmd{DATA LIST}.
 
-The END subcommand is only useful in conjunction with @cmd{INPUT
+The @subcmd{END} subcommand is only useful in conjunction with @cmd{INPUT
 PROGRAM}.  @xref{INPUT PROGRAM}, for details.
 
+The optional @subcmd{SKIP} subcommand specifies a number of records to skip at
+the beginning of an input file.  It can be used to skip over a row
+that contains variable names, for example.
+
 @cmd{DATA LIST} can optionally output a table describing how the data file
-will be read.  The TABLE subcommand enables this output, and NOTABLE
-disables it.  The default is to output the table.
+will be read.  The @subcmd{TABLE} subcommand enables this output, and
+@subcmd{NOTABLE} disables it.  The default is to output the table.
 
 The list of variables to be read from the data list must come last.
 Each line in the data record is introduced by a slash (@samp{/}).
@@ -177,7 +305,7 @@ of variable specifications may be present.
 
 Each variable specification consists of a list of variable names
 followed by a description of their location on the input line.  Sets of
-variables may be specified using the @code{DATA LIST} TO convention
+variables may be specified using the @cmd{DATA LIST} @subcmd{TO} convention
 (@pxref{Sets of
 Variables}).  There are two ways to specify the location of the variable
 on the line: columnar style and FORTRAN style.
@@ -186,7 +314,7 @@ In columnar style, the starting column and ending column for the field
 are specified after the variable name, separated by a dash (@samp{-}).
 For instance, the third through fifth columns on a line would be
 specified @samp{3-5}.  By default, variables are considered to be in
-@samp{F} format (@pxref{Input/Output Formats}).  (This default can be
+@samp{F} format (@pxref{Input and Output Formats}).  (This default can be
 changed; see @ref{SET} for more information.)
 
 In columnar style, to use a variable format other than the default,
@@ -218,7 +346,7 @@ Implied decimal places also exist in FORTRAN style.  A format
 specification with @var{d} decimal places also has @var{d} implied
 decimal places.
 
-In addition to the standard format specifiers (@pxref{Input/Output
+In addition to the standard format specifiers (@pxref{Input and Output
 Formats}), FORTRAN style defines some extensions:
 
 @table @asis
@@ -271,7 +399,7 @@ Defines the following variables:
 
 @itemize @bullet
 @item
-@code{NAME}, a 10-character-wide long string variable, in columns 1
+@code{NAME}, a 10-character-wide string variable, in columns 1
 through 10.
 
 @item
@@ -294,7 +422,7 @@ Case   NAME         INFO1   INFO2   INFO3
    3   Bill Yates      9      18       6
 @end example
 
-The @code{TABLE} keyword causes PSPP to print out a table
+The @code{TABLE} keyword causes @pspp{} to print out a table
 describing the four variables defined.
 
 @item
@@ -312,15 +440,15 @@ Defines the following variables:
 @code{ID}, a numeric variable, in columns 1-5 of the first record.
 
 @item
-@code{NAME}, a 30-character long string variable, in columns 7-36 of the
+@code{NAME}, a 30-character string variable, in columns 7-36 of the
 first record.
 
 @item
-@code{SURNAME}, a 30-character long string variable, in columns 38-67 of
+@code{SURNAME}, a 30-character string variable, in columns 38-67 of
 the first record.
 
 @item
-@code{MINITIAL}, a 1-character short string variable, in column 69 of
+@code{MINITIAL}, a 1-character string variable, in column 69 of
 the first record.
 
 @item
@@ -344,15 +472,15 @@ This example shows keywords abbreviated to their first 3 letters.
 
 @display
 DATA LIST FREE
-        [(@{TAB,'c'@}, @dots{})]
+        [(@{TAB,'@var{c}'@}, @dots{})]
         [@{NOTABLE,TABLE@}]
-        FILE='filename'
-        END=end_var
-        /var_spec@dots{}
+        [FILE='@var{file_name}' [ENCODING='@var{encoding}']]
+        [SKIP=@var{record_cnt}]
+        /@var{var_spec}@dots{}
 
-where each var_spec takes one of the forms
-        var_list [(type_spec)]
-        var_list *
+where each @var{var_spec} takes one of the forms
+        @var{var_list} [(@var{type_spec})]
+        @var{var_list} *
 @end display
 
 In free format, the input data is, by default, structured as a series
@@ -373,15 +501,16 @@ fields.  Furthermore, leading spaces at the beginnings of fields are
 not trimmed, consecutive delimiters define empty fields, and no form
 of quoting is allowed.
 
-The NOTABLE and TABLE subcommands are as in @cmd{DATA LIST FIXED} above.
-NOTABLE is the default.
+The @subcmd{NOTABLE} and @subcmd{TABLE} subcommands are as in @cmd{DATA LIST FIXED} above.
+@subcmd{NOTABLE} is the default.
 
-The FILE and END subcommands are as in @cmd{DATA LIST FIXED} above.
+The @subcmd{FILE}, @subcmd{SKIP}, and @subcmd{ENCODING} subcommands
+are as in @cmd{DATA LIST FIXED} above.
 
 The variables to be parsed are given as a single list of variable names.
 This list must be introduced by a single slash (@samp{/}).  The set of
 variable names may contain format specifications in parentheses
-(@pxref{Input/Output Formats}).  Format specifications apply to all
+(@pxref{Input and Output Formats}).  Format specifications apply to all
 variables back to the previous parenthesized format specification.  
 
 In addition, an asterisk may be used to indicate that all variables
@@ -396,15 +525,15 @@ on field width apply, but they are honored on output.
 
 @display
 DATA LIST LIST
-        [(@{TAB,'c'@}, @dots{})]
+        [(@{TAB,'@var{c}'@}, @dots{})]
         [@{NOTABLE,TABLE@}]
-        FILE='filename'
-        END=end_var
-        /var_spec@dots{}
+        [FILE='@var{file_name}' [ENCODING='@var{encoding}']]
+        [SKIP=@var{record_count}]
+        /@var{var_spec}@dots{}
 
-where each var_spec takes one of the forms
-        var_list [(type_spec)]
-        var_list *
+where each @var{var_spec} takes one of the forms
+        @var{var_list} [(@var{type_spec})]
+        @var{var_list} *
 @end display
 
 With one exception, @cmd{DATA LIST LIST} is syntactically and
@@ -441,20 +570,33 @@ the current input program.  @xref{INPUT PROGRAM}.
 
 @display
 For text files:
-        FILE HANDLE handle_name
-                /NAME='filename'
+        FILE HANDLE @var{handle_name}
+                /NAME='@var{file_name}
                 [/MODE=CHARACTER]
-                /TABWIDTH=tab_width
+                /TABWIDTH=@var{tab_width}
+                [ENCODING='@var{encoding}']
 
-For binary files with fixed-length records:
-        FILE HANDLE handle_name
-                /NAME='filename'
+For binary files in native encoding with fixed-length records:
+        FILE HANDLE @var{handle_name}
+                /NAME='@var{file_name}'
                 /MODE=IMAGE
-                [/LRECL=rec_len]
-
-To explicitly declare a scratch handle:
-        FILE HANDLE handle_name
-                /MODE=SCRATCH
+                [/LRECL=@var{rec_len}]
+                [ENCODING='@var{encoding}']
+
+For binary files in native encoding with variable-length records:
+        FILE HANDLE @var{handle_name}
+                /NAME='@var{file_name}'
+                /MODE=BINARY
+                [/LRECL=@var{rec_len}]
+                [ENCODING='@var{encoding}']
+
+For binary files encoded in EBCDIC:
+        FILE HANDLE @var{handle_name}
+                /NAME='@var{file_name}'
+                /MODE=360
+                /RECFORM=@{FIXED,VARIABLE,SPANNED@}
+                [/LRECL=@var{rec_len}]
+                [ENCODING='@var{encoding}']
 @end display
 
 Use @cmd{FILE HANDLE} to associate a file handle name with a file and
@@ -473,27 +615,130 @@ file handle name must not already have been used in a previous
 invocation of @cmd{FILE HANDLE}, unless it has been closed by an
 intervening command (@pxref{CLOSE FILE HANDLE}).
 
-MODE specifies a file mode.  In CHARACTER mode, the default, the data
-file is read as a text file, according to the local system's 
-conventions, and each text line is read as one record.
-In CHARACTER mode, most input programs will expand tabs to spaces
-(@cmd{DATA LIST FREE} with explicitly specified delimiters is an
-exception).  By default, each tab is 4 characters wide, but an
-alternate width may be specified on TABWIDTH.  A tab width of 0
-suppresses tab expansion entirely.
+The effect and syntax of @cmd{FILE HANDLE} depends on the selected MODE:
+
+@itemize
+@item
+In CHARACTER mode, the default, the data file is read as a text file,
+according to the local system's conventions, and each text line is
+read as one record.
+
+In CHARACTER mode only, tabs are expanded to spaces by input programs,
+except by @cmd{DATA LIST FREE} with explicitly specified delimiters.
+Each tab is 4 characters wide by default, but TABWIDTH (a @pspp{}
+extension) may be used to specify an alternate width.  Use a TABWIDTH
+of 0 to suppress tab expansion.
 
-In IMAGE mode, the data file is opened in ANSI C binary mode and records
-are fixed in length.  In IMAGE mode, LRECL specifies the record length in
-bytes, with a default of 1024.  Tab characters are never expanded to
-spaces in binary mode.
+@item
+In IMAGE mode, the data file is treated as a series of fixed-length
+binary records.  LRECL should be used to specify the record length in
+bytes, with a default of 1024.  On input, it is an error if an IMAGE
+file's length is not a integer multiple of the record length.  On
+output, each record is padded with spaces or truncated, if necessary,
+to make it exactly the correct length.
 
-The NAME subcommand specifies the name of the file associated with the
-handle.  It is required in CHARACTER and IMAGE modes.
+@item
+In BINARY mode, the data file is treated as a series of
+variable-length binary records.  LRECL may be specified, but its value
+is ignored.  The data for each record is both preceded and followed by
+a 32-bit signed integer in little-endian byte order that specifies the
+length of the record.  (This redundancy permits records in these
+files to be efficiently read in reverse order, although @pspp{} always
+reads them in forward order.)  The length does not include either
+integer.
 
-The SCRATCH mode designates the file handle as a scratch file handle.
-Its use is usually unnecessary because file handle names that begin with
-@samp{#} are assumed to refer to scratch files.  @pxref{File Handles},
-for more information.
+@item
+Mode 360 reads and writes files in formats first used for tapes in the
+1960s on IBM mainframe operating systems and still supported today by
+the modern successors of those operating systems.  For more
+information, see @cite{OS/400 Tape and Diskette Device Programming},
+available on IBM's website.
+
+Alphanumeric data in mode 360 files are encoded in EBCDIC.  @pspp{}
+translates EBCDIC to or from the host's native format as necessary on
+input or output, using an ASCII/EBCDIC translation that is one-to-one,
+so that a ``round trip'' from ASCII to EBCDIC back to ASCII, or vice
+versa, always yields exactly the original data.
+
+The @subcmd{RECFORM} subcommand is required in mode 360.  The precise file
+format depends on its setting:
+
+@table @asis
+@item F
+@itemx FIXED
+This record format is equivalent to IMAGE mode, except for EBCDIC
+translation.
+
+IBM documentation calls this @code{*F} (fixed-length, deblocked)
+format.
+
+@item V
+@itemx VARIABLE
+The file comprises a sequence of zero or more variable-length blocks.
+Each block begins with a 4-byte @dfn{block descriptor word} (BDW).
+The first two bytes of the BDW are an unsigned integer in big-endian
+byte order that specifies the length of the block, including the BDW
+itself.  The other two bytes of the BDW are ignored on input and
+written as zeros on output.
+
+Following the BDW, the remainder of each block is a sequence of one or
+more variable-length records, each of which in turn begins with a
+4-byte @dfn{record descriptor word} (RDW) that has the same format as
+the BDW.  Following the RDW, the remainder of each record is the
+record data.
+
+The maximum length of a record in VARIABLE mode is 65,527 bytes:
+65,535 bytes (the maximum value of a 16-bit unsigned integer), minus 4
+bytes for the BDW, minus 4 bytes for the RDW.
+
+In mode VARIABLE, LRECL specifies a maximum, not a fixed, record
+length, in bytes.  The default is 8,192.
+
+IBM documentation calls this @code{*VB} (variable-length, blocked,
+unspanned) format.
+
+@item VS
+@itemx SPANNED
+The file format is like that of VARIABLE mode, except that logical
+records may be split among multiple physical records (called
+@dfn{segments}) or blocks.  In SPANNED mode, the third byte of each
+RDW is called the segment control character (SCC).  Odd SCC values
+cause the segment to be appended to a record buffer maintained in
+memory; even values also append the segment and then flush its
+contents to the input procedure.  Canonically, SCC value 0 designates
+a record not spanned among multiple segments, and values 1 through 3
+designate the first segment, the last segment, or an intermediate
+segment, respectively, within a multi-segment record.  The record
+buffer is also flushed at end of file regardless of the final record's
+SCC.
+
+The maximum length of a logical record in VARIABLE mode is limited
+only by memory available to @pspp{}.  Segments are limited to 65,527
+bytes, as in VARIABLE mode.
+
+This format is similar to what IBM documentation call @code{*VS}
+(variable-length, deblocked, spanned) format.
+@end table
+
+In mode 360, fields of type A that extend beyond the end of a record
+read from disk are padded with spaces in the host's native character
+set, which are then translated from EBCDIC to the native character
+set.  Thus, when the host's native character set is based on ASCII,
+these fields are effectively padded with character @code{X'80'}.  This
+wart is implemented for compatibility.
+@end itemize
+
+The @subcmd{NAME} subcommand specifies the name of the file associated with the
+handle.  It is required in all modes but SCRATCH mode, in which its
+use is forbidden.
+
+The ENCODING subcommand specifies the encoding of text in the file.
+For reading text files in CHARACTER mode, all of the forms described
+for ENCODING on the INSERT command are supported (@pxref{INSERT}).
+For reading in other file-based modes, encoding autodetection is not
+supported; if the specified encoding requests autodetection then the
+default encoding will be used.  This is also true when a file handle
+is used for writing a file in any mode.
 
 @node INPUT PROGRAM
 @section INPUT PROGRAM
@@ -507,7 +752,7 @@ END INPUT PROGRAM.
 
 @cmd{INPUT PROGRAM}@dots{}@cmd{END INPUT PROGRAM} specifies a
 complex input program.  By placing data input commands within @cmd{INPUT
-PROGRAM}, PSPP programs can take advantage of more complex file
+PROGRAM}, @pspp{} programs can take advantage of more complex file
 structures than available with only @cmd{DATA LIST}.
 
 The first sort of extended input program is to simply put multiple @cmd{DATA
@@ -523,7 +768,7 @@ stop when end of file is reached on any of the data files.
 
 To prevent @cmd{INPUT PROGRAM} from terminating at the first end of
 file, use
-the END subcommand on @cmd{DATA LIST}.  This subcommand takes a
+the @subcmd{END} subcommand on @cmd{DATA LIST}.  This subcommand takes a
 variable name,
 which should be a numeric scratch variable (@pxref{Scratch Variables}).
 (It need not be a scratch variable but otherwise the results can be
@@ -537,7 +782,7 @@ structure produces one case.  @cmd{END CASE} controls exactly
 when cases are output.  When @cmd{END CASE} is used, looping from the end of
 @cmd{INPUT PROGRAM} to the beginning does not cause a case to be output.
 
-@cmd{END FILE} is the second.  When the END subcommand is used on @cmd{DATA
+@cmd{END FILE} is the second.  When the @subcmd{END} subcommand is used on @cmd{DATA
 LIST}, there is no way for the @cmd{INPUT PROGRAM} construct to stop
 looping,
 so an infinite loop results.  @cmd{END FILE}, when executed,
@@ -546,6 +791,8 @@ structure.
 
 All this is very confusing.  A few examples should help to clarify.
 
+@c If you change this example, change the regression test1 in
+@c tests/command/input-program.sh to match.
 @example
 INPUT PROGRAM.
         DATA LIST NOTABLE FILE='a.data'/X 1-10.
@@ -558,6 +805,8 @@ The example above reads variable X from file @file{a.data} and variable
 Y from file @file{b.data}.  If one file is shorter than the other then
 the extra data in the longer file is ignored.
 
+@c If you change this example, change the regression test2 in
+@c tests/command/input-program.sh to match.
 @example
 INPUT PROGRAM.
         NUMERIC #A #B.
@@ -581,6 +830,8 @@ The above example reads variable X from @file{a.data} and variable Y from
 field is set to the system-missing value alongside the present value for
 the remaining length of the longer file.
 
+@c If you change this example, change the regression test3 in
+@c tests/command/input-program.sh to match.
 @example
 INPUT PROGRAM.
         NUMERIC #A #B.
@@ -603,8 +854,10 @@ LIST.
 @end example
 
 The above example reads data from file @file{a.data}, then from
-@file{b.data}, and concatenates them into a single active file.
+@file{b.data}, and concatenates them into a single active dataset.
 
+@c If you change this example, change the regression test4 in
+@c tests/command/input-program.sh to match.
 @example
 INPUT PROGRAM.
         NUMERIC #EOF.
@@ -632,6 +885,8 @@ LIST.
 The above example does the same thing as the previous example, in a
 different way.
 
+@c If you change this example, make similar changes to the regression
+@c test5 in tests/command/input-program.sh.
 @example
 INPUT PROGRAM.
         LOOP #I=1 TO 50.
@@ -643,7 +898,7 @@ END INPUT PROGRAM.
 LIST/FORMAT=NUMBERED.
 @end example
 
-The above example causes an active file to be created consisting of 50
+The above example causes an active dataset to be created consisting of 50
 random variates between 0 and 10.
 
 @node LIST
@@ -652,31 +907,28 @@ random variates between 0 and 10.
 
 @display
 LIST
-        /VARIABLES=var_list
-        /CASES=FROM start_index TO end_index BY incr_index
-        /FORMAT=@{UNNUMBERED,NUMBERED@} @{WRAP,SINGLE@} 
-                @{NOWEIGHT,WEIGHT@}
+        /VARIABLES=@var{var_list}
+        /CASES=FROM @var{start_index} TO @var{end_index} BY @var{incr_index}
+        /FORMAT=@{UNNUMBERED,NUMBERED@} @{WRAP,SINGLE@}
 @end display
 
 The @cmd{LIST} procedure prints the values of specified variables to the
 listing file.
 
-The VARIABLES subcommand specifies the variables whose values are to be
-printed.  Keyword VARIABLES is optional.  If VARIABLES subcommand is not
-specified then all variables in the active file are printed.
+The @subcmd{VARIABLES} subcommand specifies the variables whose values are to be
+printed.  Keyword VARIABLES is optional.  If @subcmd{VARIABLES} subcommand is not
+specified then all variables in the active dataset are printed.
 
-The CASES subcommand can be used to specify a subset of cases to be
-printed.  Specify FROM and the case number of the first case to print,
-TO and the case number of the last case to print, and BY and the number
+The @subcmd{CASES} subcommand can be used to specify a subset of cases to be
+printed.  Specify @subcmd{FROM} and the case number of the first case to print,
+@subcmd{TO} and the case number of the last case to print, and @subcmd{BY} and the number
 of cases to advance between printing cases, or any subset of those
-settings.  If CASES is not specified then all cases are printed.
+settings.  If @subcmd{CASES} is not specified then all cases are printed.
 
-The FORMAT subcommand can be used to change the output format.  NUMBERED
-will print case numbers along with each case; UNNUMBERED, the default,
-causes the case numbers to be omitted.  The WRAP and SINGLE settings are
-currently not used.  WEIGHT will cause case weights to be printed along
-with variable values; NOWEIGHT, the default, causes case weights to be
-omitted from the output.
+The @subcmd{FORMAT} subcommand can be used to change the output format.  @subcmd{NUMBERED}
+will print case numbers along with each case; @subcmd{UNNUMBERED}, the default,
+causes the case numbers to be omitted.  The @subcmd{WRAP} and @subcmd{SINGLE} settings are
+currently not used.
 
 Case numbers start from 1.  They are counted after all transformations
 have been considered.
@@ -687,108 +939,6 @@ cannot fit on a single line, then a multi-line format will be used.
 
 @cmd{LIST} is a procedure.  It causes the data to be read.
 
-@node MATRIX DATA
-@section MATRIX DATA
-@vindex MATRIX DATA
-
-@display
-MATRIX DATA
-        /VARIABLES=var_list
-        /FILE='filename'
-        /FORMAT=@{LIST,FREE@} @{LOWER,UPPER,FULL@} @{DIAGONAL,NODIAGONAL@}
-        /SPLIT=@{new_var,var_list@}
-        /FACTORS=var_list
-        /CELLS=n_cells
-        /N=n
-        /CONTENTS=@{N_VECTOR,N_SCALAR,N_MATRIX,MEAN,STDDEV,COUNT,MSE,
-                   DFE,MAT,COV,CORR,PROX@}
-@end display
-
-@cmd{MATRIX DATA} command reads square matrices in one of several textual
-formats.  @cmd{MATRIX DATA} clears the dictionary and replaces it and
-reads a
-data file.
-
-Use VARIABLES to specify the variables that form the rows and columns of
-the matrices.  You may not specify a variable named @code{VARNAME_}.  You
-should specify VARIABLES first.
-
-Specify the file to read on FILE, either as a file name string or a file
-handle (@pxref{File Handles}).  If FILE is not specified then matrix data
-must immediately follow @cmd{MATRIX DATA} with a @cmd{BEGIN
-DATA}@dots{}@cmd{END DATA}
-construct (@pxref{BEGIN DATA}).
-
-The FORMAT subcommand specifies how the matrices are formatted.  LIST,
-the default, indicates that there is one line per row of matrix data;
-FREE allows single matrix rows to be broken across multiple lines.  This
-is analogous to the difference between @cmd{DATA LIST FREE} and
-@cmd{DATA LIST LIST}
-(@pxref{DATA LIST}).  LOWER, the default, indicates that the lower
-triangle of the matrix is given; UPPER indicates the upper triangle; and
-FULL indicates that the entire matrix is given.  DIAGONAL, the default,
-indicates that the diagonal is part of the data; NODIAGONAL indicates
-that it is omitted.  DIAGONAL/NODIAGONAL have no effect when FULL is
-specified.
-
-The SPLIT subcommand is used to specify @cmd{SPLIT FILE} variables for the
-input matrices (@pxref{SPLIT FILE}).  Specify either a single variable
-not specified on VARIABLES, or one or more variables that are specified
-on VARIABLES.  In the former case, the SPLIT values are not present in
-the data and ROWTYPE_ may not be specified on VARIABLES.  In the latter
-case, the SPLIT values are present in the data.
-
-Specify a list of factor variables on FACTORS.  Factor variables must
-also be listed on VARIABLES.  Factor variables are used when there are
-some variables where, for each possible combination of their values,
-statistics on the matrix variables are included in the data.
-
-If FACTORS is specified and ROWTYPE_ is not specified on VARIABLES, the
-CELLS subcommand is required.  Specify the number of factor variable
-combinations that are given.  For instance, if factor variable A has 2
-values and factor variable B has 3 values, specify 6.
-
-The N subcommand specifies a population number of observations.  When N
-is specified, one N record is output for each @cmd{SPLIT FILE}.
-
-Use CONTENTS to specify what sort of information the matrices include.
-Each possible option is described in more detail below.  When ROWTYPE_
-is specified on VARIABLES, CONTENTS is optional; otherwise, if CONTENTS
-is not specified then /CONTENTS=CORR is assumed.
-
-@table @asis
-@item N
-@item N_VECTOR
-Number of observations as a vector, one value for each variable.
-@item N_SCALAR
-Number of observations as a single value.
-@item N_MATRIX
-Matrix of counts.
-@item MEAN
-Vector of means.
-@item STDDEV
-Vector of standard deviations.
-@item COUNT
-Vector of counts.
-@item MSE
-Vector of mean squared errors.
-@item DFE
-Vector of degrees of freedom.
-@item MAT
-Generic matrix.
-@item COV
-Covariance matrix.
-@item CORR
-Correlation matrix.
-@item PROX
-Proximities matrix.
-@end table
-
-The exact semantics of the matrices read by @cmd{MATRIX DATA} are complex.
-Right now @cmd{MATRIX DATA} isn't too useful due to a lack of procedures
-accepting or producing related data, so these semantics aren't
-documented.  Later, they'll be described here in detail.
-
 @node NEW FILE
 @section NEW FILE
 @vindex NEW FILE
@@ -797,7 +947,8 @@ documented.  Later, they'll be described here in detail.
 NEW FILE.
 @end display
 
-@cmd{NEW FILE} command clears the current active file.
+@cmd{NEW FILE} command clears the dictionary and data from the current
+active dataset.
 
 @node PRINT
 @section PRINT
@@ -805,35 +956,38 @@ NEW FILE.
 
 @display
 PRINT 
-        OUTFILE='filename'
-        RECORDS=n_lines
+        OUTFILE='@var{file_name}'
+        RECORDS=@var{n_lines}
         @{NOTABLE,TABLE@}
-        /[line_no] arg@dots{}
+        [/[@var{line_no}] @var{arg}@dots{}]
 
-arg takes one of the following forms:
-        'string' [start-end]
-        var_list start-end [type_spec]
-        var_list (fortran_spec)
-        var_list *
+@var{arg} takes one of the following forms:
+        '@var{string}' [@var{start}-@var{end}]
+        @var{var_list} @var{start}-@var{end} [@var{type_spec}]
+        @var{var_list} (@var{fortran_spec})
+        @var{var_list} *
 @end display
 
-The @cmd{PRINT} transformation writes variable data to an output file.
-@cmd{PRINT} is executed when a procedure causes the data to be read.
-Follow @cmd{PRINT} by @cmd{EXECUTE} to print variable data without
-invoking a procedure (@pxref{EXECUTE}).
+The @cmd{PRINT} transformation writes variable data to the listing
+file or an output file.  @cmd{PRINT} is executed when a procedure
+causes the data to be read.  Follow @cmd{PRINT} by @cmd{EXECUTE} to
+print variable data without invoking a procedure (@pxref{EXECUTE}).
 
-All @cmd{PRINT} subcommands are optional.
+All @cmd{PRINT} subcommands are optional.  If no strings or variables
+are specified, @cmd{PRINT} outputs a single blank line.
 
-The OUTFILE subcommand specifies the file to receive the output.  The
+The @subcmd{OUTFILE} subcommand specifies the file to receive the output.  The
 file may be a file name as a string or a file handle (@pxref{File
-Handles}).  If OUTFILE is not present then output will be sent to PSPP's
-output listing file.
+Handles}).  If @subcmd{OUTFILE} is not present then output will be sent to
+@pspp{}'s output listing file.  When @subcmd{OUTFILE} is present, a space is
+inserted at beginning of each output line, even lines that otherwise
+would be blank.
 
-The RECORDS subcommand specifies the number of lines to be output.  The
+The @subcmd{RECORDS} subcommand specifies the number of lines to be output.  The
 number of lines may optionally be surrounded by parentheses.
 
-TABLE will cause the PRINT command to output a table to the listing file
-that describes what it will print to the output file.  NOTABLE, the
+@subcmd{TABLE} will cause the @cmd{PRINT} command to output a table to the listing file
+that describes what it will print to the output file.  @subcmd{NOTABLE}, the
 default, suppresses this output table.
 
 Introduce the strings and variables to be printed with a slash
@@ -843,6 +997,7 @@ line number, the next line number will be specified.  Multiple lines may
 be specified using multiple slashes with the intended output for a line
 following its respective slash.
 
+
 Literal strings may be printed.  Specify the string itself.  Optionally
 the string may be followed by a column number or range of column
 numbers, specifying the location on the line for the string to be
@@ -868,20 +1023,32 @@ again extend the line to that length.
 
 @display
 PRINT EJECT 
-        OUTFILE='filename'
-        RECORDS=n_lines
+        OUTFILE='@var{file_name}'
+        RECORDS=@var{n_lines}
         @{NOTABLE,TABLE@}
-        /[line_no] arg@dots{}
+        /[@var{line_no}] @var{arg}@dots{}
 
-arg takes one of the following forms:
-        'string' [start-end]
-        var_list start-end [type_spec]
-        var_list (fortran_spec)
-        var_list *
+@var{arg} takes one of the following forms:
+        '@var{string}' [@var{start}-@var{end}]
+        @var{var_list} @var{start}-@var{end} [@var{type_spec}]
+        @var{var_list} (@var{fortran_spec})
+        @var{var_list} *
 @end display
 
-@cmd{PRINT EJECT} writes data to an output file.  Before the data is
-written, the current page in the listing file is ejected.
+@cmd{PRINT EJECT} advances to the beginning of a new output page in
+the listing file or output file.  It can also output data in the same
+way as @cmd{PRINT}.
+
+All @cmd{PRINT EJECT} subcommands are optional.
+
+Without @subcmd{OUTFILE}, @cmd{PRINT EJECT} ejects the current page in
+the listing file, then it produces other output, if any is specified.
+
+With @subcmd{OUTFILE}, @cmd{PRINT EJECT} writes its output to the specified file.
+The first line of output is written with @samp{1} inserted in the
+first column.  Commonly, this is the only line of output.  If
+additional lines of output are specified, these additional lines are
+written with a space inserted in the first column, as with @subcmd{PRINT}.
 
 @xref{PRINT}, for more information on syntax and usage.
 
@@ -890,12 +1057,12 @@ written, the current page in the listing file is ejected.
 @vindex PRINT SPACE
 
 @display
-PRINT SPACE OUTFILE='filename' n_lines.
+PRINT SPACE OUTFILE='file_name' n_lines.
 @end display
 
 @cmd{PRINT SPACE} prints one or more blank lines to an output file.
 
-The OUTFILE subcommand is optional.  It may be used to direct output to
+The @subcmd{OUTFILE} subcommand is optional.  It may be used to direct output to
 a file specified by file name as a string or file handle (@pxref{File
 Handles}).  If OUTFILE is not specified then output will be directed to
 the listing file.
@@ -917,14 +1084,14 @@ data file
 already processed by @cmd{DATA LIST} or another input command to be re-read
 for further processing.
 
-The FILE subcommand, which is optional, is used to specify the file to
+The @subcmd{FILE} subcommand, which is optional, is used to specify the file to
 have its line re-read.  The file must be specified as the name of a file
 handle (@pxref{File Handles}).  If FILE is not specified then the last
 file specified on @cmd{DATA LIST} will be assumed (last file specified
 lexically, not in terms of flow-of-control).
 
 By default, the line re-read is re-read in its entirety.  With the
-COLUMN subcommand, a prefix of the line can be exempted from
+@subcmd{COLUMN} subcommand, a prefix of the line can be exempted from
 re-reading.  Specify an expression (@pxref{Expressions}) evaluating to
 the first column that should be included in the re-read line.  Columns
 are numbered from 1 at the left margin.
@@ -938,18 +1105,18 @@ file.  Instead, it will re-read the same line multiple times.
 
 @display
 REPEATING DATA
-        /STARTS=start-end
-        /OCCURS=n_occurs
-        /FILE='filename'
-        /LENGTH=length
-        /CONTINUED[=cont_start-cont_end]
-        /ID=id_start-id_end=id_var
+        /STARTS=@var{start}-@var{end}
+        /OCCURS=@var{n_occurs}
+        /FILE='@var{file_name}'
+        /LENGTH=@var{length}
+        /CONTINUED[=@var{cont_start}-@var{cont_end}]
+        /ID=@var{id_start}-@var{id_end}=@var{id_var}
         /@{TABLE,NOTABLE@}
-        /DATA=var_spec@dots{}
+        /DATA=@var{var_spec}@dots{}
 
-where each var_spec takes one of the forms
-        var_list start-end [type_spec]
-        var_list (fortran_spec)
+where each @var{var_spec} takes one of the forms
+        @var{var_list} @var{start}-@var{end} [@var{type_spec}]
+        @var{var_list} (@var{fortran_spec})
 @end display
 
 @cmd{REPEATING DATA} parses groups of data repeating in
@@ -960,7 +1127,7 @@ When used with @cmd{DATA LIST}, it
 can be used to parse groups of cases that share a subset of variables
 but differ in their other data.
 
-The STARTS subcommand is required.  Specify a range of columns, using
+The @subcmd{STARTS} subcommand is required.  Specify a range of columns, using
 literal numbers or numeric variable names.  This range specifies the
 columns on the first line that are used to contain groups of data.  The
 ending column is optional.  If it is not specified, then the record
@@ -968,11 +1135,11 @@ width of the input file is used.  For the inline file (@pxref{BEGIN
 DATA}) this is 80 columns; for a file with fixed record widths it is the
 record width; for other files it is 1024 characters by default.
 
-The OCCURS subcommand is required.  It must be a number or the name of a
+The @subcmd{OCCURS} subcommand is required.  It must be a number or the name of a
 numeric variable.  Its value is the number of groups present in the
 current record.
 
-The DATA subcommand is required.  It must be the last subcommand
+The @subcmd{DATA} subcommand is required.  It must be the last subcommand
 specified.  It is used to specify the data present within each repeating
 group.  Column numbers are specified relative to the beginning of a
 group at column 1.  Data is specified in the same way as with @cmd{DATA LIST
@@ -986,23 +1153,23 @@ default is the last file handle used on @cmd{DATA LIST} (lexically, not in
 terms of flow of control).
 
 By default @cmd{REPEATING DATA} will output a table describing how it will
-parse the input data.  Specifying NOTABLE will disable this behavior;
+parse the input data.  Specifying @subcmd{NOTABLE} will disable this behavior;
 specifying TABLE will explicitly enable it.
 
-The LENGTH subcommand specifies the length in characters of each group.
-If it is not present then length is inferred from the DATA subcommand.
+The @subcmd{LENGTH} subcommand specifies the length in characters of each group.
+If it is not present then length is inferred from the @subcmd{DATA} subcommand.
 LENGTH can be a number or a variable name.
 
 Normally all the data groups are expected to be present on a single
-line.  Use the CONTINUED command to indicate that data can be continued
+line.  Use the @subcmd{CONTINUED} command to indicate that data can be continued
 onto additional lines.  If data on continuation lines starts at the left
 margin and continues through the entire field width, no column
-specifications are necessary on CONTINUED.  Otherwise, specify the
+specifications are necessary on @subcmd{CONTINUED}.  Otherwise, specify the
 possible range of columns in the same way as on STARTS.
 
 When data groups are continued from line to line, it is easy
 for cases to get out of sync through careless hand editing.  The
-ID subcommand allows a case identifier to be present on each line of
+@subcmd{ID} subcommand allows a case identifier to be present on each line of
 repeating data groups.  @cmd{REPEATING DATA} will check for the same
 identifier on each line and report mismatches.  Specify the range of
 columns that the identifier will occupy, followed by an equals sign
@@ -1020,25 +1187,42 @@ structure (@pxref{LOOP}).  Use @cmd{DATA LIST} before, not after,
 
 @display
 WRITE 
-        OUTFILE='filename'
-        RECORDS=n_lines
+        OUTFILE='@var{file_name}'
+        RECORDS=@var{n_lines}
         @{NOTABLE,TABLE@}
-        /[line_no] arg@dots{}
+        /[@var{line_no}] @var{arg}@dots{}
 
-arg takes one of the following forms:
-        'string' [start-end]
-        var_list start-end [type_spec]
-        var_list (fortran_spec)
-        var_list *
+@var{arg} takes one of the following forms:
+        '@var{string}' [@var{start}-@var{end}]
+        @var{var_list} @var{start}-@var{end} [@var{type_spec}]
+        @var{var_list} (@var{fortran_spec})
+        @var{var_list} *
 @end display
 
 @code{WRITE} writes text or binary data to an output file.  
 
-@xref{PRINT}, for more information on syntax and usage.  The main
-difference between @code{PRINT} and @code{WRITE} is that @cmd{WRITE}
-uses write formats by default, where PRINT uses print formats.
+@xref{PRINT}, for more information on syntax and usage.  @cmd{PRINT}
+and @cmd{WRITE} differ in only a few ways:
 
-The sole additional difference is that if @cmd{WRITE} is used to send output
-to a binary file, carriage control characters will not be output.
-@xref{FILE HANDLE}, for information on how to declare a file as binary.
-@setfilename ignored
+@itemize @bullet
+@item
+@cmd{WRITE} uses write formats by default, whereas @cmd{PRINT} uses
+print formats.
+
+@item
+@cmd{PRINT} inserts a space between variables unless a format is
+explicitly specified, but @cmd{WRITE} never inserts space between
+variables in output.
+
+@item
+@cmd{PRINT} inserts a space at the beginning of each line that it
+writes to an output file (and @cmd{PRINT EJECT} inserts @samp{1} at
+the beginning of each line that should begin a new page), but
+@cmd{WRITE} does not.
+
+@item
+@cmd{PRINT} outputs the system-missing value according to its
+specified output format, whereas @cmd{WRITE} outputs the
+system-missing value as a field filled with spaces.  Binary formats
+are an exception.
+@end itemize