BYTE Function

Returns one character in the ASCII or the EBCDIC collating sequence.

Category: Character
Restriction: I18N Level 0 functions are designed for use with Single Byte Character Sets (SBCS) only.
See: BYTE Function: UNIX in SAS Companion for UNIX Environments
BYTE Function: Windows in SAS Companion for Windows


BYTE (n)

Required Argument


specifies an integer that represents a specific ASCII or EBCDIC character.

Range 0–255


Length of Returned Variable

In a DATA step, if the BYTE function returns a value to a variable that has not previously been assigned a length, then that variable is assigned a length of 1.

ASCII and EBCDIC Collating Sequences

For EBCDIC collating sequences, n is between 0 and 255. For ASCII collating sequences, the characters that correspond to values between 0 and 127 represent the standard character set. Other ASCII characters that correspond to values between 128 and 255 are available on certain ASCII operating environments, but the information those characters represent varies with the operating environment.


The following SAS statements produce these results.
SAS Statement
put x;

See Also