CHAR2INT: Translating a Character to an Integer Value

Available Operating Systems: All

Available Languages: Maintain

How to:

Translate a Character Into an Integer Value

Example:

Translating a Character Into an Integer Value

The CHAR2INT function translates an ASCII or EBCDIC character to the integer value it represents, depending on the operating system.


Top of page

Syntax: How to Translate a Character Into an Integer Value

CHAR2INT("character")

where:

character

Is the ASCII or EBCDIC character to translate into its integer value.


Top of page

Example: Translating a Character Into an Integer Value

CHAR2INT translates the character X into its integer equivalent.

MAINTAIN
INT/I3=CHAR2INT("X");
type "INT IS <INT";
END

On an ASCII platform, the integer value would be 120.

On an EBCDIC platform, the integer value would be 231.