Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Conversions between EBCDIC and UTF-16 representation

In addition to the implicit conversions in the case of moves and relation conditions, conversions can be performed explicitly with the aid of FUNCTIONs:

  • NATIONAL-OF returns the national representation (UTF-16) of an alphanumeric argument

  • DISPLAY-OF returns the alphanumeric representation (EBCDIC) of a national argument

As an optional second argument, both functions permit a replacement character to be specified which is used in place of characters which have no equivalent in the other character set.

Example 12-17

01 n  PIC N(3) VALUE NX"E23A00410040".
01 a  PIC X VALUE "?".
FUNCTION DISPLAY-OF (n, a)

The function call returns an alphanumeric data item containing "?A@" because the first national character has no EBCDIC equivalent. The replacement character "?" is used for this in the result.