Previous Topic: NOTIFY StatementNext Topic: $HEXTOCHAR Function


$CHARTOHEX Function

The $CHAR‑TO‑HEX PDL function can display non‑printable fields. It returns the hexadecimal value of the specified field contents as an alphanumeric string. The length of the receiving field should be at least twice the size of the sending field to avoid truncation.

This function has the following format:

               {alpha-expression}
$CHAR TO HEX ( {num-field       } )
               {num-literal     }
               {flag            }
alpha‑expression

Alphanumeric expression

num‑field

Numeric field name

num‑literal

Numeric literal

flag

Flag

Example

Assume that FLD‑1 is an alphanumeric field equal to 'ABCD'.

LIST $CHAR-TO-HEX(FLD-1)

Lists 'C1C2C3C4' to the output destination. If FLD‑1 were defined in working data as a five‑byte field, the value listed would be 'C1C2C3C440'.

For more information about $CHAR-TO-HEX function, see the Programming Reference Guide.