A more recent development is SAS/GIS, or Geographical Information Systems software. GIS is an interactive environment in which maps can be drawn and manipulated with great flexibility. SAS/GIS is introduced later in this document.
PROC GMAP can be used to produce choropleth, surface, prism, and block maps. PROC GMAP requires a MAPS data set as well as a RESPONSE data set for input. This MAPS data set can be one the user has created or one of the MAPS data sets supplied by SAS. Therefore, if you want to use the MAPS data set provided by SAS, your LIBNAME statement would appear as follows:
LIBNAME MAPLIB '<--directory holding the maps files-->';
In UNIX systems: To see the maps that are available, type:
ls /usr/usc/sas/default/maps
Each map file has a descriptive name, followed by .ssd01
followed by .Z, which indicates that it is
compressed. For example, one map of El Salvador is named
salvador.ssd01.Z
To prepare this map file for your use, you would uncompress it
into /tmp space,
or into one of your own directories (for
example, ~/mymaps), as follows:
zcat /usr/usc/sas/default/maps/salvador.ssd01.Z >
~/mymaps/salvador.ssd01
(The two lines above are actually a single command, to be typed on one line at your UNIX prompt.)
Note that it doesn't matter what you call your copy of the file,
but you must have the extension .ssd01 for it to work.
In SAS for Windows or Macintosh: To see the maps that are available, find the directory they are in by clicking Globals>Access>Display Libraries, then type an 'S' (select) to the left of the MAPS libname. This will display a list of all the files in that library, i.e., all the available maps data sets.
You cannot tell from the file name whether the files are compressed, so if you don't otherwise know, you can run the Map Data Sets Utility which will tell you if the Map Data Sets are compressed and give you the option of uncompressing them. To run this utility, click Help>Utility then choose the SAS/GRAPH Maps Data Set Utility.
libname maplib '~/mymaps'; /*<--this is a UNIX example */
libname maplib 'c:\saswin\maps'; /*<--this is a Windows example */
libname maplib 'SAS:Maps'; /*<--this is a Macintosh example */
proc gmap data=<your SAS data set> map=maplib.salvador;
NOTE: In Public User Rooms, the maps will be on a network server drive; for details, see the SAS for Microcomputers document at:
A PROC that uses the maps, then, could make use of the same LIBREF and would specify the SAS data set containing an Africa map as follows:
proc gmap data=<your SAS data set> map=maplib.africa;
A response data set is a SAS data set that contains, for each unit area, one or more reponses to be mapped. For example, if you were interested in the number of elementary schools in each state of the U.S., the response data set might contain the number of schools in each unit area (in this case the unit area would be STATES), and the MAPS data set would be the U.S. In addition, you would need one or more ID variables that would uniquely define the unit area. In the example above the ID variable would be STATES. Thus, PROC GMAP would look as follows:
proc gmap data=schools map=maplib.us; id states;