hex value display

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Deepakkumar
New Member
Posts: 5
Joined: Wed Dec 25, 2013 5:07 pm

hex value display

Post by Deepakkumar »

Dear experts:
how can i see hex value of a variable.
like
01 A pic 9(4) value 1234.
01 B pic s9(4) comp-3.
but when we move A to B. then when we display comp-3. it shows 1234.i know because display convert it from packed to zoned for display..

can it is possible that we can show this hex value....... :)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: hex value display

Post by Robert Sample »

Google is your friend. When I Googled cobol show hex data the first link returned is http://www-01.ibm.com/support/docview.w ... wg21177358 which contains a COBOL program to display hexadecimal data.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: hex value display

Post by William Collins »

REDEDFINES B as PIC X(3). DISPLAY that field. Use SET HEX ON (or similar for what you use for looking at the spool) to see the hex value.

Or find a program that can display your storage in hex (I'd pass up on the horrible one Robert found, but it is from IBM...)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”