Hello,
First - there is
no null value in cobol data. Every value from x'00' to x'ff' is a
real value. Any book or teacher than calls x'00' a null is providing incorrect information.
One way to see the the hex values is to set up an array with values like:
01 hex-array.
05 filler pic x(32) value '000102030405060708090A0B0C0D0E0F'.
all of the other values. . .
05 filler pic x(32) value 'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'.
01 hex-iitems redefines hex-array.
05 hex-values occurs 256 times indexed by hex-inx.
10 hex-over pic x.
10 hex-under pic x.
You can then use the numeric value of each byte as the displacement into the array. If you build 2 arrays for output, you can create the "over" and "under" hex values and then present the hex data very similar to the way it can be seen using HEX ON.
There is another way to do this without the hex-array and if i can find it quickly, i'll post it also. I still use the array because it is in a callable routine that i've used since. . . well, a long, long time. . . And hex hasn't changed - works on all 3 major platforms (Win-based, unix, and mainframe)