B.1 File Header Record
The file header is always the first record in the file. It has the
- Record type code, set to `$FL2'.
- Product identification string. This always begins with the characters
`@(#) SPSS DATA FILE'. PSPP uses the remaining characters to
give its version and the operating system name; for example, `GNU
pspp 0.1.4 - sparc-sun-solaris2.5.2'. The string is truncated if it
would be longer than 60 characters; otherwise it is padded on the right
- Normally set to 2, although a few system files have been spotted in
the wild with a value of 3 here. PSPP use this value to determine the
file's integer endianness (see System File Format).
- Number of data elements per case. This is the number of variables,
except that long string variables add extra data elements (one for every
8 characters after the first 8). However, string variables do not
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.
- Set to 1 if the data in the file is compressed, 0 otherwise.
- If one of the variables in the data set is used as a weighting
variable, set to the dictionary index of that variable, plus 1
(see Dictionary Index). Otherwise, set to 0.
- Set to the number of cases in the file if it is known, or -1 otherwise.
In the general case it is not possible to determine the number of cases
that will be output to a system file at the time that the header is
written. The way that this is dealt with is by writing the entire
system file, including the header, then seeking back to the beginning of
the file and writing just the
ncases field. For `files' in which
this is not valid, the seek operation fails. In this case,
ncases remains -1.
- Compression bias, ordinarily set to 100. Only integers between
1 - bias and
251 - bias can be compressed.
By assuming that its value is 100, PSPP uses
bias to determine
the file's floating-point format and endianness (see System File Format). If the compression bias is not 100, PSPP cannot auto-detect
the floating-point format and assumes that it is IEEE 754 format with
the same endianness as the system file's integers, which is correct
for all known system files.
- Date of creation of the system file, in `dd mmm yy'
format, with the month as standard English abbreviations, using an
initial capital letter and following with lowercase. If the date is not
available then this field is arbitrarily set to `01 Jan 70'.
- Time of creation of the system file, in `hh:mm:ss'
format and using 24-hour time. If the time is not available then this
field is arbitrarily set to `00:00:00'.
- File label declared by the user, if any (see FILE LABEL). Padded on the right with spaces.
- Ignored padding bytes to make the structure a multiple of 32 bits in
length. Set to zeros.