contents.gifindex.gifprev1.gifnext1.gif

HEX2ASCII Routine

HEX2ASCII converts hexadecimal data from a non-displayable hexadecimal format to its ASCII equivalent. This routine is the inverse of the ASCII2HEX routine.

Usage

 CALL "HEX2ASCII"
   USING ASCII-VALUE, HEX-VALUE

Parameters

ASCII-VALUE PIC X(2)

Output data area to contain the ASCII representation of a unit of data

HEX-VALUE PIC X(4)

Input data area containing the hexadecimal value

Note: When you are defining the parameters, use the exact field sizes specified in the calling conventions above, otherwise the runtime may terminate abnormally.

Note: Any characters that are not valid hexadecimal digits are treated as the digit "0". Trailing spaces are removed from the input value before conversion.