COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-13
CHAR Function
CHAR Function
CHAR, an alphanumeric function, returns a character whose ordinal number in the
program collating sequence is the value of its argument.
argument
is an integer greater than zero and less than or equal to n, where n is the number
of positions in the program collating sequence.
If more than one character has the same position in the program collating sequence,
the returned character is the first character that the ALPHABET clause specifies for
that character position. If the current program collating sequence was not specified by
an ALPHABET clause, HP COBOL uses the ASCII program collating sequence.
Example 14-5. CHAR Function Without ALPHABET Clause
Code:
DISPLAY FUNCTION CHAR (36)
DISPLAY FUNCTION CHAR (43)
DISPLAY FUNCTION CHAR (54)
DISPLAY FUNCTION CHAR (69)
DISPLAY FUNCTION CHAR (99)
Output:
#
*
5
D
b
( )
CHARFUNCTION argument
VST425.vsd