Logical Operator Routines

The logic routines carry out logic operations on bits. Apart from CBL_NOT, all these operations have two operands.

If the length is specified as a literal and there is no RETURNING clause then native code is optimized to generate inline code.

In the two-operand routines, interchanging the two operands, source and target, does not change the result except in CBL_IMP. However, the result is always stored in the second operand, target.

If length is longer than either data item, bytes following that data item are used, up to the length specified.

The parameter length can be replaced by the syntax:

        length of source

or:

        length of target

assuming all the bytes of the data item are to be used.

Logical AND and OR operations can also be carried out using the VALUE clause.

RETURN-CODE is not affected by these routines.