Next: , Previous: Input and Output Formats, Up: Basic Concepts

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). 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. 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. Otherwise, its possible contents depend on its width:

0 (numeric values)
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.
1...MAX_SHORT_STRING - 1 (short string values)
Up to three discrete string values (with the same width as the set).
MAX_SHORT_STRING...MAX_STRING (long string values)
Always empty.

These somewhat arbitrary restrictions are the same as those imposed by SPSS. In PSPP we could easily eliminate these restrictions, but doing so would also require us to extend the system file format in an incompatible way, which we consider a bad tradeoff.

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 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. No function for destroying a struct missing_values is provided, because struct missing_values does not contain any pointers or other references to resources that need deallocation.