Next: Variable Value Labels, Previous: Variable Type and Width, Up: Variables [Contents][Index]
A numeric or short string variable may have a set of user-missing
values (see MISSING VALUES in PSPP Users Guide), represented
as a struct missing_values
(see User-Missing Values).
The most frequent operation on a variable’s missing values is to query whether a value is user- or system-missing:
Tests whether value is a missing value of the given class
for variable var and returns true if so, false otherwise.
var_is_num_missing
may only be applied to numeric variables;
var_is_str_missing
may only be applied to string variables.
value must have been initialized with the same width as
var.
var_is_type_missing (var, value, class)
is equivalent to mv_is_type_missing
(var_get_missing_values (var), value, class)
.
In addition, a few functions are provided to work more directly with a
variable’s struct missing_values
:
Returns the struct missing_values
associated with var. The
caller must not modify the returned structure. The return value is
always non-null.
Changes var’s missing values to a copy of miss, or if miss is a null pointer, clears var’s missing values. If miss is non-null, it must have the same width as var or be resizable to var’s width (see mv_resize). The caller retains ownership of miss.
Clears var’s missing values. Equivalent to
var_set_missing_values (var, NULL)
.
Returns true if var has any missing values, false if it has
none. Equivalent to mv_is_empty (var_get_missing_values (var))
.
Next: Variable Value Labels, Previous: Variable Type and Width, Up: Variables [Contents][Index]