Header

Extends\SPSS\Sav\Record

package

Default

Methods

Record constructor.

__construct(array $data = array())
inherited

Arguments

$data

array

create

create(array $data = array()): static
inheritedstatic

Arguments

$data

array

Response

static

fill

fill(\SPSS\Buffer $buffer,array $data = array()): static
inheritedstatic

Arguments

$buffer

\SPSS\Buffer

$data

array

Response

static

increaseCasesCount

increaseCasesCount(\SPSS\Buffer $buffer)

Arguments

$buffer

\SPSS\Buffer

read

read(\SPSS\Buffer $buffer)

Arguments

$buffer

\SPSS\Buffer

toArray

toArray(): array
inherited

Response

array

write

write(\SPSS\Buffer $buffer)

Arguments

$buffer

\SPSS\Buffer

Constants

NORMAL_REC_TYPE

NORMAL_REC_TYPE

ZLIB_REC_TYPE

ZLIB_REC_TYPE

Properties

Record type code, either ‘$FL2’ for system files with uncompressed data or data compressed with simple bytecode compression, or ‘$FL3’ for system files with ZLIB compressed data. This is truly a character field that uses the character encoding as other strings. Thus, in a file with an ASCII-based character encoding this field contains 24 46 4c 32 or 24 46 4c 33, and in a file with an EBCDIC-based encoding this field contains 5b c6 d3 f2. (No EBCDIC-based ZLIB-compressed files have been observed.)

recType :string
var

Record type code, either ‘$FL2’ for system files with uncompressed data or data compressed with simple bytecode compression, or ‘$FL3’ for system files with ZLIB compressed data. This is truly a character field that uses the character encoding as other strings. Thus, in a file with an ASCII-based character encoding this field contains 24 46 4c 32 or 24 46 4c 33, and in a file with an EBCDIC-based encoding this field contains 5b c6 d3 f2. (No EBCDIC-based ZLIB-compressed files have been observed.)

Type(s)

string

Product identification string. This always begins with the characters ‘@(#) SPSS DATA FILE’. The string is truncated if it would be longer than 60 characters; otherwise it is padded on the right with spaces.

prodName :string
var

Product identification string. This always begins with the characters ‘@(#) SPSS DATA FILE’. The string is truncated if it would be longer than 60 characters; otherwise it is padded on the right with spaces.

Type(s)

string

normally set to 2, although a few system files have been spotted in the wild with a value of 3 here

layoutCode :integer
var

normally set to 2, although a few system files have been spotted in the wild with a value of 3 here

Type(s)

integer

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.

nominalCaseSize :integer
var

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.

Type(s)

integer

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 recType is ‘$FL3’.

compression :integer
var

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 recType is ‘$FL3’.

Type(s)

integer

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.

weightIndex :integer
var

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.

Type(s)

integer

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.

casesCount :integer
var

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.

Type(s)

integer

Compression bias, ordinarily set to 100. Only integers between 1 - bias and 251 - bias can be compressed. By assuming that its value is 100.

bias :integer
var

Compression bias, ordinarily set to 100. Only integers between 1 - bias and 251 - bias can be compressed. By assuming that its value is 100.

Type(s)

integer

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’.

creationDate :string
var

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’.

Type(s)

string

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’.

creationTime :string
var

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’.

Type(s)

string

File label declared by the user (64 chars). Padded on the right with spaces.

fileLabel :string
var

File label declared by the user (64 chars). Padded on the right with spaces.

Type(s)

string