Language Reference |
BYTE Function |
The BYTE function returns values in a computer’s character set. The input to the function is a numeric matrix, each element of which specifies the position of a character in the computer’s character set. These numeric elements should generally be in the range 0 to 255. The BYTE function returns a character matrix with the same shape as the numeric argument.
For example, in the ASCII character set, the following two statements are equivalent:
a1 = byte(47); a2 = "/"; /* the slash character */ print a1 a2;
The lowercase English letters can be generated with the following statement, shown in Figure 23.50:
y = byte(97:122); print y;
The BYTE function simplifies the use of special characters and control sequences that cannot be entered directly into SAS/IML programs by using the keyboard. Consult the character set tables for your computer to determine the printable and control characters that are available and their ordinal positions.
Copyright © SAS Institute, Inc. All Rights Reserved.