Client-Library allows parameters to have a “null” value; that is, to contain no information, not even blanks. A null value is usually represented in COBOL by LOW-VALUES.
There are several rules for assigning null values to arguments:
For handles, an application assigns the following symbolic values to indicate a null:
CS-NULL-CONTEXT for context handles.
CS-NULL-CONHANDLE for connection handles
CS-NULL-CMD for command handles
For output arguments:
Arguments that return a single integer are never null.
Arguments that return longer values can be null. A null value is indicated by a separate argument, indicating that the argument of interest should be treated as null.
For arguments that have a corresponding length argument, assign the value CS-NULL-STRING to the corresponding length argument, if one is present, to indicate that the value of an argument should be treated as null.
For DATAFMT structures, you indicate a null field by
setting FMT-MAXLEN to zero.
For arguments that have NULL indicators, assign CS-PARAM-NULL to the indicator argument.
For example, CTBBIND has the arguments COPIED and COPIED-NULL. If COPIED is null, assign CS-PARAM-NULL to COPIED-NULL. If COPIED is not null, assign CS-PARAM-NOTNULL to COPIED-NULL.
For all other variables, assign CS-UNUSED to indicate that the argument should be ignored.
The FMT-FORMAT field of the DATAFMT structure of CTBBIND can be padded with either blanks or nulls. CS-FMT-PADNULL pads with LOW-VALUES; CS-FMT-PADBLANK pads with blanks.