Next: , Previous: , Up: Basic Concepts   [Contents][Index]


2.3 User-Missing Values

In addition to the system-missing value for numeric values, each variable has a set of user-missing values (see MISSING VALUES in PSPP Users Guide). A set of user-missing values is represented by struct missing_values.

It is rarely necessary to interact directly with a struct missing_values object. Instead, the most common operation, querying whether a particular value is a missing value for a given variable, is most conveniently executed through functions on struct variable. See Variable Missing Values, for details.

A struct missing_values is essentially a set of union values that have a common value width (see Values). For a set of missing values associated with a variable (the common case), the set’s width is the same as the variable’s width.

Function prototypes and other declarations related to missing values are declared in data/missing-values.h.

Structure: struct missing_values

Opaque type that represents a set of missing values.

The contents of a set of missing values is subject to some restrictions. Regardless of width, a set of missing values is allowed to be empty. A set of numeric missing values may contain up to three discrete numeric values, or a range of numeric values (which includes both ends of the range), or a range plus one discrete numeric value. A set of string missing values may contain up to three discrete string values (with the same width as the set), but ranges are not supported.

In addition, values in string missing values wider than MV_MAX_STRING bytes may contain non-space characters only in their first MV_MAX_STRING bytes; all the bytes after the first MV_MAX_STRING must be spaces. See mv_is_acceptable, for a function that tests a value against these constraints.

Macro: int MV_MAX_STRING

Number of bytes in a string missing value that are not required to be spaces. The current value is 8, a value which is fixed by the system file format. In PSPP we could easily eliminate this restriction, but doing so would also require us to extend the system file format in an incompatible way, which we consider a bad tradeoff.

The most often useful functions for missing values are those for testing whether a given value is missing, described in the following section. Several other functions for creating, inspecting, and modifying struct missing_values objects are described afterward, but these functions are much more rarely useful.


Next: Value Labels, Previous: Input and Output Formats, Up: Basic Concepts   [Contents][Index]