C2X (Character to Hexadecimal)

Read syntax diagramSkip visual syntax diagram
>>-C2X--(--string--)-------------------------------------------><

returns a string, in character format, that represents string converted to hexadecimal. The returned string contains twice as many bytes as the input string. For example, on an EBCDIC system, C2X(1) returns F1 because the EBCDIC representation of the character 1 is 'F1'X.

The string returned uses uppercase alphabetics for the values A–F and does not include blanks. The string can be of any length. If string is null, returns a null string.

Here are some examples:
C2X('72s')      ->    'F7F2A2' /* 'C6F7C6F2C1F2'X in EBCDIC */
C2X('0123'X)    ->    '0123'   /* 'F0F1F2F3'X     in EBCDIC */


c2x.html | Timestamp icon Last updated: Monday, 5 June 2017