How to use a bit wise operation to mask part (one bit) of a data element?

Document ID : KB000054795
Last Modified Date : 14/02/2018
Show Technical Document Details

Chapter 11 of the Cobol Reference Guide describes the MLI_AND, which performs a bitwise logical AND function.

CALL 'MLI_AND' USING source destination

CALL 'MLI_AND' USING source1 source2 destination

This function performs a bitwise logical AND function. All the operands must have the same PICTURE and a length of one, two, or four bytes.

The first form does a logical AND of the source data item with the destination data item, leaving the result in destination.

The second form does a logical AND of the source1 and source2 operands together and leaves the result in destination.