×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# 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".

David L.

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

XOR can be expressed in terms of logical disjunction, conjunction, and negation (for example see here). You have those available in the subprogram library (C\$LogicalAnd, etc); see the RM/COBOL User's Guide for more information.

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.

(OP)
Thank you very much,

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.

David, welcome to Tek-Tips.

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

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!