The DISPLAY-OF function returns a string which contains the characters of the argument converted into alphanumeric representation.
The type of this function is alphanumeric.
Format
FUNCTION DISPLAY-OF (argument-1 [argument-2])
Arguments
argument-1 must be of the national class and at least one character long.
argument-1 may not be defined with the ANY LENGTH clause.
argument-2 must be of the alphabetic class and precisely one character long.
When conversion takes place in the result, argument-2 specifies a replacement character in place of the national characters for which there are no corresponding alphanumeric characters.
Returned values
As a return value a string is supplied in which each national character from argument-1 is converted into its corresponding character in alphanumeric representation.
If argument-2 is specified, each character from argument-1 for which no corresponding character exists in alphanumeric representation is converted into the replacement character specified by argument-2.
If argument-2 is not specified and argument-1 contains characters for which no corresponding character exists in alphanumeric representation, these are converted into a replacement character defined by XHCS (period ’.’). The exceptional condition EC-DATA-CONVERSION occurs.
The return value contains exactly as many characters as argument-1.
The error return value is a blank.
If FUNCTION DISPLAY-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.
See also: NATIONAL-OF
Example 9-14
... DATA DIVISION. WORKING-STORAGE SECTION. 01 nat PIC XXX VALUE NX"E23A005A0040". 01 var PIC X VALUE "z". 01 R PIC xxx. PROCEDURE DIVISION. MAIN. DISPLAY FUNCTION DISPLAY-OF (nat, var). STOP RUN.
Result: zZ@