NATIONAL-OF

The NATIONAL-OF function returns a national character string consisting of the national character representation of the characters in argument-1.

The type of the function is national.

Format

Read syntax diagramSkip visual syntax diagramFUNCTION NATIONAL-OF (argument-1 argument-2)
argument-1
Must be of class alphabetic, alphanumeric, UTF-8, or DBCS. argument-1 specifies the source string for the conversion.
argument-2
Must be an integer. argument-2 identifies the source code page for the conversion.

argument-2 must be a valid CCSID number and must identify an EBCDIC, ASCII, UTF-8, or EUC code page. An EBCDIC or ASCII code page can contain both single-byte and double-byte characters.

If argument-2 is omitted and argument-1 is of class UTF-8, then the source code page is 1208. Otherwise, the source code page is the one that was in effect for the CODEPAGE compiler option when the source code was compiled.

The returned value is a national character string consisting of the characters of argument-1 converted to national character representation. When a source character cannot be converted to a national character, the source character is converted to a substitution character. The substitution character is:

  • X'001A' if converting a single-byte character
  • X'FFFD' if converting a multi-byte character

No exception condition is raised.

The length of the returned value depends on the content of argument-1 and the characteristics of the source code page.

Usage note: The CCSID for UTF-8 is 1208.

Exception: If the conversion fails, a severe runtime error occurs. Verify that the z/OS® Unicode conversion services are installed and are configured to include the table for converting from the source code page to CCSID 1200. See the Customization Guide for installation requirements to support the conversion.