Next: , Up: User-Missing Values   [Contents][Index]


2.3.1 Testing for Missing Values

The most often useful functions for missing values are those for testing whether a given value is missing, described here. However, using one of the corresponding missing value testing functions for variables can be even easier (see Variable Missing Values).

Function: bool mv_is_value_missing (const struct missing_values *mv, const union value *value, enum mv_class class)
Function: bool mv_is_num_missing (const struct missing_values *mv, double value, enum mv_class class)
Function: bool mv_is_str_missing (const struct missing_values *mv, const char value[], enum mv_class class)

Tests whether value is in one of the categories of missing values given by class. Returns true if so, false otherwise.

mv determines the width of value and provides the set of user-missing values to test.

The only difference among these functions in the form in which value is provided, so you may use whichever function is most convenient.

The class argument determines the exact kinds of missing values that the functions test for:

Enumeration: enum mv_class
MV_USER

Returns true if value is in the set of user-missing values given by mv.

MV_SYSTEM

Returns true if value is system-missing. (If mv represents a set of string values, then value is never system-missing.)

MV_ANY
MV_USER | MV_SYSTEM

Returns true if value is user-missing or system-missing.

MV_NONE

Always returns false, that is, value is never considered missing.