X2C (Hexadecimal to Character)

The X2C function returns a string, in character format, that represents hexstring converted to character.

Read syntax diagramSkip visual syntax diagram X2C( hexstring )

The returned string is half as many bytes as the original hexstring. hexstring can be of any length. If necessary, it is padded with a leading 0 to make an even number of hexadecimal digits.

You can optionally include blanks in hexstring (at byte boundaries only, not leading or trailing) to aid readability; they are ignored.

If hexstring is null, the function returns a null string.

Examples

X2C('F7F2 A2')    ->    '72s'       /*  EBCDIC                     */
X2C('F7f2a2')     ->    '72s'       /*  EBCDIC                     */
X2C('F')          ->    ' '         /*  '0F' is unprintable EBCDIC */