## quick question. XOR in RM/Cobol.

## quick question. XOR in RM/Cobol.

(OP)

Hello,

I work with RM/Cobol 7.03 and RM/Cobol 11, according to some sources i've checked it's not possible to do a "XOR" expression in cobol.

Hopefully one one you guys can help me with this. BTW sorry for my broken english, this is not my mother language.

I need to calculate an LCR(Hexadecimal) in Cobol.

ex. I need to take this string "01,50,1,T0501,78174,0,0,11,0,1,"

then do (0 XOR 1) = RES, do (RES XOR 1) = RES2, do (RES2 XOR ,) and continue for every character of the given string(commas included). The final result sould be an Hexadecimal value. According to the string source the result should be a "59".

Thanks in advance.

David L.

I work with RM/Cobol 7.03 and RM/Cobol 11, according to some sources i've checked it's not possible to do a "XOR" expression in cobol.

Hopefully one one you guys can help me with this. BTW sorry for my broken english, this is not my mother language.

I need to calculate an LCR(Hexadecimal) in Cobol.

ex. I need to take this string "01,50,1,T0501,78174,0,0,11,0,1,"

then do (0 XOR 1) = RES, do (RES XOR 1) = RES2, do (RES2 XOR ,) and continue for every character of the given string(commas included). The final result sould be an Hexadecimal value. According to the string source the result should be a "59".

Thanks in advance.

David L.

## RE: quick question. XOR in RM/Cobol.

Another way is to create a table of XOR results, and use the binary value of the bytes to do a lookup. See thread209-571499: CRC in COBOL where I demonstarte this technique.

Tom Morrison

Hill Country Software

## RE: quick question. XOR in RM/Cobol.

Found the subprogram library for the XOR in the RM/guide and Works great. Now i feel bad for not searching first on the user guide. Amazingly not a single article, fórum, post i read mentioned this.

Thanks again for the quick reply.

David Lopez.

## RE: quick question. XOR in RM/Cobol.

Bit-wise boolean operations are/were not common in COBOL. So, proprietary solutions are created by the COBOL vendors prior to the standardization of bit data types and boolean operations in 2002. In RM/COBOL (which is built on the 1985 standard) we chose to use CALL rather than extend the COBOL language.

Tom Morrison

Consultant