Add support for reading SPSS/PC+ system files.
[pspp] / doc / dev / system-file-format.texi
index 0da1997b3f7f8b611040d62aa9d17dfefd752c76..d100aa9d24d59fcd6265e73e70310d6b556403f8 100644 (file)
@@ -178,7 +178,7 @@ contribute to this value beyond the first 255 bytes.   Further, system
 files written by some systems set this value to -1.  In general, it is
 unsafe for systems reading system files to rely upon this value.
 
-@item int32 compressed;
+@item int32 compression;
 Set to 0 if the data in the file is not compressed, 1 if the data is
 compressed with simple bytecode compression, 2 if the data is ZLIB
 compressed.  This field has value 2 if and only if @code{rec_type} is
@@ -316,12 +316,19 @@ the at-sign (@samp{@@}).  Subsequent characters may also be digits, octothorpes
 (@samp{#}), dollar signs (@samp{$}), underscores (@samp{_}), or full
 stops (@samp{.}).  The variable name is padded on the right with spaces.
 
+The @samp{name} fields should be unique within a system file.  System
+files written by SPSS that contain very long string variables with
+similar names sometimes contain duplicate names that are later
+eliminated by resolving the very long string names (@pxref{Very Long
+String Record}).  PSPP handles duplicates by assigning them new,
+unique names.
+
 @item int32 label_len;
 This field is present only if @code{has_var_label} is set to 1.  It is
 set to the length, in characters, of the variable label.  The
 documented maximum length varies from 120 to 255 based on SPSS
 version, but some files have been seen with longer labels.  PSPP
-accepts longer labels and truncates them to 255 bytes on input.
+accepts labels of any length.
 
 @item char label[];
 This field is present only if @code{has_var_label} is set to 1.  It has
@@ -345,6 +352,7 @@ in the range.  When a range plus a value are present, the third
 element denotes the additional discrete missing value.
 @end table
 
+@anchor{System File Output Formats}
 The @code{print} and @code{write} members of sysfile_variable are output
 formats coded into @code{int32} types.  The least-significant byte
 of the @code{int32} represents the number of decimal places, and the
@@ -728,8 +736,8 @@ The size of each element in the @code{mrsets} member. Always set to 1.
 The total number of bytes in @code{mrsets}.
 
 @item char mrsets[];
-A series of multiple response sets, each of which consists of the
-following:
+Zero or more line feeds (byte 0x0a), followed by a series of multiple
+response sets, each of which consists of the following:
 
 @itemize @bullet
 @item
@@ -778,8 +786,15 @@ A space.
 The short names of the variables in the set, converted to lowercase,
 each separated from the previous by a single space.
 
+Even though a multiple response set must have at least two variables,
+some system files contain multiple response sets with no variables at
+all.  The source and meaning of these multiple response sets is
+unknown.  (Perhaps they arise from creating a multiple response set
+then deleting all the variables that it contains?)
+
 @item
-A line feed (byte 0x0a).
+One line feed (byte 0x0a).  Sometimes multiple, even hundreds, of line
+feeds are present.
 @end itemize
 @end table