I'm too lazy to actually write the COBOL, but what you could do is - Move the data to a field re-defined as a character array - Define an output area also defined as a character array - Define yet another character array whose values are C'01234567890abcdef' - Loop through the first array - Move each byte to the last character of a comp field initialized to zero and redefined as characters - Divide the comp field by 16. Use the quotient to index into the 01234... array for your first hex output byte. Use the remainder to index for the second hex byte. - Repeat for each input byte.
Whew! Easier to call an assembler routine! Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of John Krew Sent: Monday, November 21, 2005 2:42 PM To: [email protected] Subject: Displaying hexdecimal content of field in Cobol Aside from writing and CALLing a trivial assembler routine, is there any way to display the hexadecimal content of a field in a COBOL program using COBOL syntax? John Krew ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

