Please enable JavaScript to view this site.

The C2X function converts a character data string into a hexadecimal format. The code page of the hexadecimal translation is determined by the platform in which the C2X function was executed (i.e. EBCDIC for z/OS).

Category

String

Syntax

C2X(character_string)

 

Parameter Descriptions

character_string  -  The source data string in character format. The source data string may be a field/column of a datastore, a literal value (i.e. ABC) or the result of another Function.

Example

Convert the literal value MUSTANG into a hexadecimal format and map it to target field HEXOUT.

TARGET_DS.HEXOUT =  C2X ('MUSTANG')

Returns the 4 bytes of hexadecimal value of the word MUSTANG.

Translate the character representation of the field/column Last_Name into hexadecimal format and map it to target field HEXNAME.

HEXNAME =  C2X (Last_Name)

Returns the hexadecimal value of the contents of the field/column Last_Name.