Some fonts contain characters that are not mapped to
the keyboard and cannot be typed directly into a text string. To
display these special characters, substitute a character code or a
hexadecimal value in the text string. Hexadecimal values are recommended
over character codes.
Character codes include the letters, numbers, punctuation
marks, and symbols that are commonly found on a keyboard. They are
usually associated with symbols or national alphabets. These codes
enable you to display the character by specifying the font and using
the keyboard character in the text string. For example, on Windows
operating environments, to produce the character ζ, you can
specify the Symbol MT font and the character code
z
in the text string.
title font="Symbol MT" "z";
Hexadecimal
values are any two-digit hexadecimal numbers enclosed
in quotation marks, followed by the letter x. For example, “3D”x.
(In double-byte character sets, the hexadecimal values contain four
digits (for example, “4E60”x). Unicode characters also
contain four digits.)
You display characters
with hexadecimal values the same way you display them with character
codes. You specify the font that contains the special character and
place the hexadecimal value in the text string. For example, this
TITLE statement uses hexadecimal A9 to produce © in the Albany
AMT font.
title font="Albany AMT" "a9"x;
Note: The character code or hexadecimal
value associated with characters in a font might be dependent on the
key map that is currently being used. Keymaps are not used if the
/unicode
modifier is specified, a symbol font is specified,
or NOKEYMAP is specified in the font header. Contact Technical Support
if you need assistance with creating or modifying key maps.
To determine the hexadecimal
codes that you need to specify for a specific character, you can use
the program shown in SAS Program for Displaying Hexadecimal Codes for Special Characters. This program displays 224 characters
of a font together with the hexadecimal codes for each character.
As shown here, it displays the characters in the Symbol font. You
can change the font displayed by this program to any font available
on your system. Also, some fonts have many more characters than those
displayed by the program below.
Note: Some fonts, such as Albany
AMT, display variations due to the national characters for that locale.
Symbol fonts, such as Monotype Sorts, are not affected by your locale
encoding. For double-byte encodings, the second half of the table
might be blank or show small rectangles.
SAS Program for Displaying Hexadecimal Codes for Special Characters
goptions reset=all;
/***************************************************/
/* Generate the hexadecimal values. The A values */
/* do not include 0 and 1 because these values are */
/* reserved for commands in most hardware fonts. */
/***************************************************/
data one;
do a="2","3","4","5","6","7","8","9","a","b","c","d","e","f";
do b="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f";
char=input(a||b,$hex3.);
output;
end;
end;
run;
/***************************************************/
/* Create annotation data set to show the */
/* hexadecimal values and the corresponding font */
/* characters underneath the hexadecimal value. */
/***************************************************/
data anno;
length text $2. style $ 25.;
retain xsys "3" ysys "3"
tempy 95 x 0
size 1.5 count 0
y 0 position "6";
set one;
count = count + 1;
x = x + 4;
y = tempy;
text = compress(a||b);
style = "Albany AMT/bold";
output;
y = tempy - 3;
function = "label";
/* Modify this statement to use the */
/* font that you want to display. */
style = "Monotype Sorts";
text = char;
output;
if int(count/16) = (count/16)
then do;
x = 0;
tempy = tempy - 6;
end;
run;
/****************************************************/
/* Create the table. The symbol is shown below its */
/* hexadecimal value. For example, a circle with */
/* the number one inside is the hexadecimal value */
/* AC in the Monotype Sorts system font. To use */
/* this symbol, specify: */
/* font="Monotype Sorts" "AC"x; */
/****************************************************/
proc ganno anno=anno;
run;
quit;