If you are using the second maintenance release of SAS 9.3 (TS1M2) or later, you might have noticed that you have several map-related libraries that are defined for you.
- The MAPS library contains the old map data sets that have been provided with SAS/GRAPH® software for many years. The source for these data sets was mainly freely available data or purchased data. As a result, it became difficult or impossible to provide updates to this data.
- The MAPSGFK library contains new map data sets that are licensed through GfK Geomarketing and that are provided as part of SAS/GRAPH software.
- The MAPSSAS library points to the same location as the MAPS library.
Determining which library to use
You should use the MAPSGFK data sets to produce your maps. There are several advantages to using the MAPSGFK data sets:
- The older MAPS library data sets contain outdated data, and this library will not be updated.
- The MAPSGFK data is updated more frequently.
- The MAPSGFK data sets standardize the variables in the data set. For example, the X and Y variables always contain the projected values, and LONG and LAT always contain the unprojected values.
Each of the data sets also contains the ID variable, as shown in the following example, to enable you to create a map without knowing about the boundaries that are contained in the data set.
proc gmap data=mapsgfk.ireland_attr map=mapsgfk.ireland; id id; choro idname; run; quit;
As mentioned above, the MAPSGFK library data sets contain both projected and unprojected values, which is helpful when you use annotation with maps or when you create a subset of a map.
- The MAPSGFK.PROJPARM data set contains the parameters that were used when the projected data was created for each of the data sets. You can use these parameters with the GPROJECT procedure when you project an annotate data set. For more information about projecting an annotate data set using MAPSGFK.PROJPARM, see the sample code that appears in the section Code to Project Annotate Data with a GfK Map Data Set ("Chapter 37: GMAP Procedure") in SAS/GRAPH® 9.4: Reference, Fourth Edition.
- Many of the MAPSGFK data sets include a lower level of hierarchy for boundaries than was available previously in the map data sets, as shown in this example:
proc gmap data=mapsgfk.africa1 map=mapsgfk.africa1; id id; choro id / nolegend; run; quit;
This code sample generates the following output:
You can use the GREMOVE procedure to remove internal boundaries that you don’t want as part of your map.
- In earlier releases, the names of the map data sets in the MAPS library were limited to eight characters. The MAPGSFK data sets do not have that restriction, so you can use longer names. The longer data-set names enable you to determine the map data-set content more easily.
Determining which MAPSGFK data sets to use
To help you determine which data set to use to create your map, you can use dictionary tables in the SQL procedure to generate a list of the data sets that are contained in the MAPSGFK library, along with their associated labels.
This example illustrates how you can view the dictionary table for selected data sets (in this case, MEMNAME and MEMLABEL):
proc sql; select memname, memlabel from dictionary.tables where libname='MAPSGFK'; quit;
The following output is a partial display of the results:
The data sets that end in _ATTR are the attribute data sets for the map data set of the same base name. You can use the attribute data sets to obtain names and other information that is associated with variables in the map data set.
You can determine more information about the contents of the data sets using the DICTIONARY.MEMBERS dictionary table in PROC SQL.
proc sql; select name, type, length, label from dictionary.columns where libname='MAPSGFK' and memname='NAMERICA'; quit;
The following output shows the results:
In some cases, changing your existing PROC GMAP code to use the MAPSGFK data sets rather than the MAPS data sets might be as simple as changing the data set name in the MAP= option of the PROC GMAP statement. In other cases, this changing data sets can include changing the variables that are listed in the ID statement of PROC GMAP, including using a GREMOVE procedure step to remove a lower-level map boundary to or remove or modify a GPROJECT procedure step. You can find tips about modifying your existing PROC GMAP code to work with MAPSGFK data sets in the section Using GfK Map Data Sets with Existing Code ("Chapter 37: GMAP Procedure") in SAS/GRAPH® 9.4: Reference, Fourth Edition.
You can find more information about the new map data sets and modifying your existing map programs to use the MAPSGFK data sets in the SAS Global Forum paper The New SAS® Map Data Sets (by Darrell Massengill) and in the SAS/GRAPH Concepts section of SAS/GRAPH® 9.4: Reference, Fourth Edition.