Microsoft KB Archive/62992

COBOL Program Available to Manipulate Bits (AND, OR, NOT, XOR)

PSS ID Number: Q62992 Article last modified on 04-20-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: A file named COBBITS in the Software/Data Library contains sample programs that show how to do bit manipulation in Microsoft COBOL Compiler versions 3.0 and 3.0a for MS-DOS and MS OS/2. COBBITS can be found in the Software/Data Library by searching on the keyword COBBITS, the Q number of this article, or S12610. COBBITS was archived using the PKware file-compression utility. Microsoft COBOL Compiler versions 3.0 and 3.0a for MS-DOS and MS OS/2 do not have built-in functions for performing bit manipulating operations (AND, OR, NOT, and XOR). These functions can be simulated, however, by writing a COBOL routine to get the status (on or off) of a bit in a data item. This routine can be used to compare the status of the corresponding bits in two data items. The result of the comparisons would determine (depending on the operation) which bits would be on or off in the resulting data item.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.