CHAR: Returning a Character Based on a Numeric Code

How to:

The CHAR function accepts a decimal integer and returns the character identified by that number converted to ASCII or EBCDIC, depending on the operating environment. The output is returned as variable length alphanumeric. If the number is above the range of valid characters, a null value is returned.

Syntax: How to Return a Character Based on a Numeric Code

CHAR(number_code)

where:

number_code

Integer

Is a field, number, or numeric expression whose whole absolute value will be used as a number code to retrieve an output character.

For example, a TAB character is returned by CHAR(9) in ASCII environments, or by CHAR(5) in EBCDIC environments.

Example: Using the CHAR Function to Insert Control Characters Into a String

CHAR returns a carriage control character in an ASCII environment.

CHAR(13)

WebFOCUS

Feedback