### 5 Null values

CURSA supports null values in catalogues. Null values are used to represent a field for which no actual value is available. Null values can arise in several ways. They may be present in a catalogue when it is read by CURSA. An example might be a catalogue of multi-colour photometry for a set of stars where measures for some colours were missing for some of the stars. Null values would be used to represent the missing values. Alternatively, they might arise where an expression is being used to compute a new column and evaluation of the expression for the current row results in a ‘$÷$ by zero’ error. No valid value will be available for the expression, so a null value will be substituted.

Throughout CURSA null values have the single, simple meaning that ‘no value is available for this datum’. It is possible to invent schemes where a set of null values are supported, each with a subtly different gradation of meaning. However, CURSA does not support such schemes.

#### 5.1 Processing null values

You do not need to know all the details of how CURSA manipulates null values internally. However, the following points may be useful.

• When a value for a new column is computed from an algebraic expression in which one of the input fields is null, then the result is also null. For example, if the new column was being computed for the expression ‘x + y’ then the result would be null if either x or y (or both) were null. The generation of a null in this fashion is not considered an error and no message or warning is reported.
• When a relational expression is being used to generate a selection then rows for fields with null values occurring in the expression do not satisfy the expression. For example, if the selection was defined by ‘x > 2.0’ then rows where x is null would not satisfy the expression.
• The function NULL is available to determine whether a field is null or not. For example, to select the rows for which column x is not null the following expression would be used: ‘.NOT. NULL(x)’.

#### 5.2 Displaying null values

When null values are displayed by xcatview (see Section 11) or catview (see Section 12) they will normally be represented by the string ‘<null>’. However, if there is insufficient space to display them in this way they will be represented by the single character ‘?’.