IBM Extension
IBM Extension

Hexadecimal Literals

You can use hexadecimal notation to form a hexadecimal nonnumeric literal.

Read syntax diagramSkip visual syntax diagram
Format

>>-X"--hexadecimal-digits--"-----------------------------------><

X"
The opening delimiter for hexadecimal notation of a nonnumeric literal. (If the compiler option *APOST or the PROCESS statement option APOST is specified, the opening delimiter is X'.)
"
The closing delimiter for hexadecimal notation of a nonnumeric literal. (If the compiler option *APOST or the PROCESS statement option APOST is specified, the closing delimiter is '.)

Hexadecimal digits are characters that range from 0 to 9, a to f, and A to F, inclusive. Two hexadecimal digits represent a single character, so an even number of hexadecimal digits must be specified in each case.

The maximum length of a hexadecimal nonnumeric literal is 512 hexadecimal digits.

The continuation rules are the same as those for nonnumeric literals.

The compiler converts the hexadecimal literal into an ordinary nonnumeric literal. Hexadecimal nonnumeric literals can be used anywhere nonnumeric literals can appear.

End of IBM Extension
End of IBM Extension