Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

NATIONAL-OF - national character representation

The DISPLAY-OF function returns a string which contains the characters of the argument converted into alphanumeric representation.
The type of this function is national.

Format


FUNCTION NATIONAL-OF (argument-1 [argument-2])


Arguments

  1. argument-1 must be of the class alphabetic or alphanumeric and at least one character long.

  2. argument-1 may not be defined with the ANY LENGTH clause.

  3. argument-2 must be of the class national and precisely one character long.
    When conversion takes place in the result, argument-2 specifies a replacement character in place of the alphanumeric characters for which there is no corresponding national character.

Returned values

  1. As a return value a string is supplied in which each alphanumeric character from argument-1 is converted into its corresponding character in national representation.

  2. If argument-2 is specified, each character from argument-1 for which no corresponding character exists in national representation is converted into the replacement character specified by argument-2.

  3. If argument-2 is not specified and argument-1 contains characters for which no corresponding character exists in national representation, these are converted into a replacement character defined by XHCS (period ’.’). The exceptional condition EC-DATA-CONVERSION occurs.

  4. The return value contains exactly as many characters as argument-1.

  5. The error return value is a blank.

    If FUNCTION NATIONAL-OF is contained as a sending field in a MOVE statement for which the check for the exceptional condition EC-DATA-CONVERSION is enabled and a USE procedure also exists, the receiving item remains unchanged if the exceptional condition occurs. A MOVE statement with implicit conversion is the opposite of this.

See also: DISPLAY-OF 

Example 9-30

...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 alfa PIC XXX VALUE "ABC".
01 R PIC NNN.
PROCEDURE DIVISION.
MAIN.
    MOVE FUNCTION NATIONAL-OF (alfa) TO R.
    STOP RUN.

Result: R contains the characters ABC in UTF-16 representation.