BYTVAL: Translating a Character to a Decimal Value

How to:

The BYTVAL function translates a character to the ASCII or EBCDIC decimal value that represents it, depending on the operating system.


Top of page

x
Syntax: How to Translate a Character to a Decimal Value
BYTVAL(character, output_format)

where:

character

Alphanumeric

Is the character to be translated. If you supply more than one character, the function evaluates the first one.

output_format

Integer



Example: Translating a Character to a Decimal Value

BYTVAL translates the first character of LAST_NAME into its ASCII decimal value and stores the result in a column with the format I3.

BYTVAL(LAST_NAME,'I3')

For SMITH, the result is 83.

For JONES the result is 74.


iWay Software