Chapter Contents

Previous

Next
The GKEYMAP Procedure

Example 1: Modifying a Key Map


Procedure features:
GKEYMAP options:
DATA=
KEYMAP
NAME=
OUT=
Other features:
DATA step
GOPTIONS procedure
GOPTIONS statement
LIBNAME statement
SORT procedure
Sample library member: GR18N01

[IMAGE]

This example shows how to change multiple characters in an existing key map. It assumes that the national characters ß and ã are not on your keyboard, so you want to create a key map that provides them.

To provide the ß character, this example's key map converts the @ character into the SAS/GRAPH internal encoding for ('B8'x). Whenever the @ character is typed in text that is displayed with a software font, the character ß is drawn instead. In this case, the replacement character uses the text position that would have been used by the typed character.

Note:   Once you have modified your key map so that @ is mapped to ß, you can no longer generate @ in a software font from your keyboard when the key map is in effect.  [cautionend]

To provide the ã character, which is not on the keyboard or in the ICE table, this example's key map converts the asterisk (*) into the SAS/GRAPH internal encoding for the accent character 'D5'x (a tilde). In this case, when the character * is typed, the resulting tilde does not take up a text position but is backspaced and used as an accent over the character preceding it in the text. To create the ã character, therefore, the text must contain the two characters a*.

Note:   The example updates the current key map rather than creating a new key map so that all of the other character mapping in the key map remains in effect.  [cautionend]

 Note about code
libname gfont0 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         colors=(black blue green red)
         ftext=swiss ftitle=swissb htext=6;
 Note about code
proc goptions
   option=keymap;
run;
 Note about code
proc gkeymap name=default
   out=temp;
run;
 Note about code
data new;
   from='@';
   to='b8'x;
   output;
   from='*';
   to='d5'x;
   output;
run;
 Note about code
proc sort data=new;
   by from;
data temp;
   update temp new;
   by from;
run;
 Note about code
proc gkeymap name=mykeymap
             data=temp
             keymap;
run;
 Note about code
goptions keymap=mykeymap;
 Note about code
title1 'Kaiserstra@e';
title2 'Sa*o Paulo';
footnote j=r 'GR18N01 ';
proc gslide;
run;
quit;.
'

Log from GOPTIONS Procedure
                 SAS/GRAPH software options and parameters
                   (executing in DMS Process environment)
 KEYMAP=DEFAULT               Input character map for hardware and software
                              text


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.