/* Importing Nacogdoches county Texas into something sas/graph gmap can use ... Run sas in DMS mode Type 'gis' in sas command window File -> Build Census Tract Maps In Geography tab: Select state=texas, county=347 Nacodoches Select ">" to move into "selected counties" In Features tab: Hilight 'Census Tract Boundaries' and move back to left "<" Hilight 'Highways' and move to the right ">" Hilight 'Rivers' and move to the right ">" In Output tab: Map Entries - sasuser, tgrmaps, nac Spatial Data Entries - sasuser, nac Click 'create' to generate the map. Click 'ok'. Click 'display' button. Checkmark Highway, Rivers, and County. Exit out of gis, and save the map. Went to the following page http://support.sas.com/rnd/datavisualization/mapsonline/html/tools.html And downloaded gisexport.zip Unzipped it into the current directory. % unzip gisexport.zip Archive: gisexport.zip inflating: gisexport.sas inflating: gisexport.cpt inflating: Readmecpt.txt inflating: ReadmeSAS.txt Then, in the same sas session, I run the gisexport.sas code with the following settings/variables to create the sas/graph map dataset, and the annotate dataset (for roads and rivers) ... */ options mprint; /* In order to export a SAS/GIS map to a SAS/GRAPH map data set, */ /* there is an Experimental set of routines called the */ /* GIS Exporter. This exporter is for use only with Version 8 */ /* and beyond of the SAS System. */ /* */ /* The GIS Exporter will export data from a SAS/GIS map and */ /* create a map data set and an annotate data set that can be */ /* used with the SAS/GRAPH GMAP procedure. In addition, the */ /* final step of the export will display a map using the */ /* exported data. */ /* */ /* Macro variables are assigned to determine the names of the */ /* SAS/GIS map to export, the map and annotate data sets, and */ /* the location for the graphics output from the GMAP procedure. */ /* */ /* The GISEXPORT.CPT file is a CPORT file which contains the */ /* experimental modules for the GIS Exporter. Once you have */ /* downloaded the GISEXPORT.CPT file, it must be taken out of */ /* transport format before it can be used. The following */ /* statements will take the GISEXPORT.CPT file out of transport */ /* format and place it into the EXPORT library. The EXPORT */ /* libref points to a directory that you have WRITE access to */ /* and will contain the EXPORT catalog. */ LIBNAME EXPORT '.'; FILENAME CPTFILE './gisexport.cpt'; PROC CIMPORT FILE=CPTFILE LIB=EXPORT; RUN; /* NOTE: SAS/GIS and SAS/GRAPH Software are required in order to */ /* run the GIS Exporter. */ /* */ /* The GIS Exporter is an experimental sample program */ /* which performs NO error checking, and assumes that the */ /* specified SAS/GIS map exists and that all specified */ /* Librefs have been allocated. */ /* The following macro variables are required for the Exporter: */ /* */ /* MAPLIB - Libref containing the SAS/GIS map. The default */ /* value is SASUSER. */ /* MAPCAT - Catalog containing the SAS/GIS map. The default */ /* value is SASCAT. */ /* MAPNAME- Name of the SAS/GIS map. The default value is */ /* SASDATA. */ /* SPALIB - Libref containing the spatial data sets. The */ /* default value is SASUSER. */ /* SPANAME- Base name for the spatial data sets. The default */ /* value is SASDATA. */ /* GRALIB - Libref for the graphics output. The default value */ /* is SASUSER. */ /* GRANAME- Name of the map data set created by the export. It */ /* is stored in the library specified in the GRALIB */ /* macro variable. The default value is SASGRAP. */ /* ANNLIB - Libref for the annotate data set created by the */ /* export. The default value is SASUSER. */ /* ANNNAME- Name of the annotate data set created by the export. */ /* It is stored in the library specified in the ANNLIB */ /* macro variable. The default value is ANNO. */ /* GRAFLIB- Libref for the GRAPH catalog containing the graphics */ /* output. The default value is SASUSER. */ /* GRAFOUT- Name of the GRAPH catalog containing the graphics */ /* output. It is stored in the library specified in */ /* the GRAFLIB macro variable. */ /* LAYER2 - Name of the polygon layer to export. Usually, you */ /* would select the lowest polygon level to export, */ /* like COUNTY instead of STATE. */ /* Only one layer can be entered. */ /* Leave it blank to use the default map layer. */ /* EXTRA - Names of the additional variables to retain. */ /* This value may be left blank. */ /* In the case of a state and county map, you would */ /* want to retain the state value. */ /* sasuser.tgrmaps.nacog */ /* define the parameters for the export */ %let MAPLIB=sasuser; %let MAPCAT=tgrmaps; %let MAPNAME=nac; %let SPALIB=sasuser; %let SPANAME=nac; %let GRALIB=sasuser; %let GRANAME=nacmap; %let ANNLIB=sasuser; %let ANNNAME=nacann; %let GRAFLIB=sasuser; %let GRAFOUT=naccat; %let LAYER2=county; %let EXTRA=; /* The EXPORT libref points to the location of the export catalog.*/ libname export '.'; /* Perform the export. When the export finishes, it will display */ /* a map using the GMAP procedure and the map and annotate data */ /* sets created by the export. */ dm 'af c=export.export.exportv81.scl; run;' graph1; /* Now that you have seen what your map and annotate data sets */ /* look like, you can use them to generate your customized map. */ /* Refer to the macro variables defined above for the library and */ /* data set names to use. */ /******************************************************************/ /* THE FILES CONTAINED HEREIN ARE PROVIDED BY SAS INSTITUTE INC. */ /* "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR */ /* IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES */ /* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* RECIPIENTS ACKNOWLEDGE AND AGREE THAT SAS INSTITUTE SHALL NOT */ /* BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING OUT OF THEIR USE */ /* OF THIS MATERIAL. IN ADDITION, SAS INSTITUTE WILL PROVIDE NO */ /* SUPPORT FOR THE MATERIALS CONTAINED HEREIN. */ /******************************************************************/ libname here '.'; /* Make a copy of the map */ data here.nacog; set sasuser.nacmap; run; /* Make a copy of the annotate dataset (and assign colors) */ data here.nacogann; set sasuser.nacann; if trim(left(what)) eq 'RIVERS' then color='blue'; if trim(left(what)) eq 'HIGHWAY' then color='green'; run;