HEX2ASCII converts hexadecimal data from the non-displayable hexadecimal format to its ASCII equivalent. This routine is the inverse of the ASCII2HEX routine.
CALL "HEX2ASCII" USING ASCII-VALUE, HEX-VALUE
ASCII-VALUE PIC X(2) | The ASCII representation of a unit of data. |
HEX-VALUE PIC X(4) | The hexadecimal value. |
When you are defining the parameters, use the exact field sizes specified in the calling conventions above, otherwise the runtime may terminate abnormally.
Any characters that are not valid hexadecimal digits are treated as the digit 0. Trailing spaces are removed from the input value before conversion.