The DISPLAY-OF function returns an alphanumeric character string consisting of the content of argument-1 converted to a specific code page representation.
The type of the function is alphanumeric.
If argument-2 is of class alphanumeric, it must identify a primary or alias code-page name that is supported by ICU conversion libraries (see International Components for Unicode: Converter Explorer).
If argument-2 is an integer, the integer must be a valid CCSID number.
If argument-2 is omitted, the output code page is determined from the runtime locale.
The returned value is an alphanumeric character string consisting of the characters of argument-1 converted to the output code page representation. When a source character cannot be converted to a character in the output code page, the source character is replaced with a substitution character. The following table shows substitution characters for some widely-used code pages:
| Output code page | Substitution character |
|---|---|
SBCS ASCII |
X'7F' |
| ISO SBCS | X'1A' |
| EBCDIC SBCS | X'3F' |
| ASCII DBCS | X'FCFC' |
| EBCDIC DBCS (except for Thai) | X'FEFE' |
| EBCDIC DBCS (Thai) | X'41B8' |
| PC DBCS (Japanese or Chinese) | X'FCFC' |
| PC DBCS (Korean) | X'BFFC' |
| EUC (Korean) | X'AFFE' |
| EUC (Japanese) | X'747E' |
| UTF-8 | From SBCS: X'1A' |
| UTF-16 | From SBCS: X'001A' |
No exception condition is raised.
The length of the returned value depends on the content of argument-1 and the characteristics of the output code page.
Usage notes
Exception: If the conversion fails, a severe runtime error occurs.