Using %HEX with COBOL
You can use the %HEX
function with the LIST
command
to display the hexadecimal value of an operand. For example, to display the external
representation of the packed decimal pvar3
, defined
as PIC 9(9)
, from 1234 as its hexadecimal (or internal)
equivalent, enter:
LIST %HEX (pvar3);
The Log window displays the hexadecimal string X'F0F0F0F0F0F1F2F3F4'
.