Variable

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

getSegmentName

getSegmentName(integer $seg): string

Arguments

$seg

integer

Response

string

Returns true if WIDTH is a very long string width, false otherwise.

isVeryLong(integer $width): integer
static

Arguments

$width

integer

Response

integer

read

read(\SPSS\Buffer $buffer)

Arguments

$buffer

\SPSS\Buffer

toArray

toArray(): array
inherited

Response

array

write

write(\SPSS\Buffer $buffer)

Arguments

$buffer

\SPSS\Buffer

writeBlank

writeBlank(\SPSS\Buffer $buffer,integer $width)

Arguments

$buffer

\SPSS\Buffer

$width

integer

Constants

TYPE

TYPE

Number of bytes really stored in each segment of a very long string variable.

REAL_VLS_CHUNK

Number of bytes per segment by which the amount of space for very long string variables is allocated.

EFFECTIVE_VLS_CHUNK

Properties

Set to 0 for a numeric variable.

width :integer

For a short string variable or the first part of a long string variable, this is set to the width of the string. For the second and subsequent parts of a long string variable, set to -1, and the remaining fields in the structure are ignored.

var

variable width

Type(s)

integer

The real record position of the variable inside the file.

realPosition :

Type(s)

If the variable has no missing values, set to 0.

missingValuesFormat :integer

If the variable has one, two, or three discrete missing values, set to 1, 2, or 3, respectively. If the variable has a range for missing variables, set to -2; if the variable has a range for missing variables plus a single discrete value, set to -3. A long string variable always has the value 0 here. A separate record indicates missing values for long string variables.

var
see

Type(s)

integer

Print format for this variable.

print :array

[decimals, width, format, 0].

var

Type(s)

array

Write format for this variable.

write :array

[decimals, width, format, 0].

var

Type(s)

array

The variable name must begin with a capital letter or the at-sign (‘@’).

name :string

Subsequent characters may also be digits, octothorpes (‘#’), dollar signs (‘$’), underscores (‘_’), or full stops (‘.’). The variable name is padded on the right with spaces.

var

variable name

Type(s)

string

It has length label_len, rounded up to the nearest multiple of 32 bits.

label :string

The first label_len characters are the variable’s variable label.

var

Type(s)

string

It has the same number of 8-byte elements as the absolute value of $missingValuesFormat.

missingValues :array

Each element is interpreted as a number for numeric variables (with HIGHEST and LOWEST indicated as described in the chapter introduction). For string variables of width less than 8 bytes, elements are right-padded with spaces; for string variables wider than 8 bytes, only the first 8 bytes of each missing value are specified, with the remainder implicitly all spaces. For discrete missing values, each element represents one missing value. When a range is present, the first element denotes the minimum value in the range, and the second element denotes the maximum value in the range. When a range plus a value are present, the third element denotes the additional discrete missing value.

var

Type(s)

array