This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I display hexadecimal representation of an alphanumeric value?

I have below variable:


 05 WS-KEY1 PIC X(08).

 05 WS-KEY2 PIC X(50).

While trying to read WS-KEY against the file, I am getting file status code of 23 (which means that record is not present). However, when I checked the file, I can see the record.

I am suspecting that the WS-KEY2 has junk value somewhere in it which might be leading status code of 23. How can I display the hexadecimal value of WS-KEY (or WS-KEY2 alone) to check if it has any junk value. I tried using HEX-OF function but I believe that may not be relevant for RM/COBOL.