Sample 61209: SAS® Visual Analytics 7.x geographic tables for U.S. counties custom polygons
Overview
Defining custom geographic polygons, or geo regions, is supported beginning with SAS Visual Analytics 7.4.
The SAS® Visual Analytics 7.5: Administration Guide includes a section for "Geographic Maps." This section includes an example for defining custom polygons for U.S. counties. In that example, the ID for U.S. counties is CS-12345, where ‘12345’ are unique, sequential numbers that are assigned to each U.S. county.
In some cases, there is a business requirement for the U.S. county ID to be US-00999, where ‘00’ is the state FIPS code and ‘999’ is the county FIPS code. This sample provides the geographic tables necessary to implement U.S. counties using state and county FIPS code in the county ID.
This sample includes a compressed file containing the following SAS data tables:
US_COUNTIES1
ATTRLOOKUP
CENTLOOKUP
US_COUNTIES1_VALIDATE_STATE
Here is a sample of the US_COUNTIES1_VALIDATE_STATE table showing U.S.county ID as US-<StateFIPS><CountyFIPS>.

Implementing the SAS Visual Analytics Geographic Tables for U.S. Counties
1. Create a new MAPSCSTM library
- Define and pre-assign a MAPSCSTM library to contain the custom polygon data sets.
A suggested location for this library is <sas-configuration-directory>/Lev1/SASApp/MAPSCSTM. Include a LIBNAME statement in your appserver_autoexec_usermods.sas file, located by default at <sas-configuration-directory>/Lev1/SASApp. After you have modified your autoexec file, restart the SAS Object Spawner.
- Copy the US_COUNTIES1 table from this sample into the MAPSCSTM directory.
2. Replace the Existing VALIB tables
The VALIB (SASApp – valib) library is predefined and pre-assigned during a standard SAS Visual Analytics installation. By default, the VALIB directory is located under <sas-configuration-directory>/Lev1/SASApp/Data/valib.
- Back up or rename the current ATTRLOOKUP and CENTLOOKUP tables in your environment.
- Copy the ATTRLOOKUP and CENTLOOKUP tables from this sample into the VALIB directory.
3. Copy the validation table
- Copy the US_COUNTIES1_VALIDATE_STATE table from this sample into the MAPSCSTM directory, or any other location, so that the table can be imported into SAS Visual Analytics.
4. Restart the web application server
- After copying all SAS data sets in both the VALIB and MAPSCSTM libraries, restart the web application server where SAS Visual Analytics is deployed in order to ensure that all updates have been applied to SAS Visual Analytics.
Verifying U.S. Counties in SAS Visual Analytics
Option 1
The SAS® package file on the Downloads tab contains a sample SAS Visual Analytics 7.4 report that uses the US_COUNTIES1_VALIDATE_STATE table and includes a geographic hierarchy for country, state, and U.S. county.
- Import the US_COUNTIES1_VALIDATE_STATE SAS data table into the SAS® LASR™ Analytic Server.
- Import the SAS package file using SAS® Management Console. For more information, see "Introduction to the Promotion Tools" in the SAS® 9.4 Intelligence Platform: System Administration Guide.
- Open the US Counties sample report in SAS® Visual Analytics Designer or SAS® Visual Analytics Explorer (available in release 7.4 and earlier).
Option 2
- Create a new report in the SAS Visual Analytics Designer or a new visualization in SAS Visual Analytics Explorer.
- If the data has not already been loaded, import the US_COUNTIES1_VALIDATE_STATE table into the SAS LASR Analytic Server.
- Specify the US_COUNTIES1_VALIDATE_STATE table as the data source for the report or visualization.
- Right-click the NAME column. Select Geography ► Subdivision (State, Province) Names. In the Province Names pop-up window, select United States.
- Add a geo region map to the report canvas and assign NAME to the Geography role.
- Change the Color role to MEASURE1 or MEASURE2 in order to better view the different U.S. counties.
- Right-click the ID column. Select Geography ► Subdivision (State, Province) SAS Map ID Values.
- Change the Geography role on the geo region map to ID.
These sample files and code examples 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.
These sample files and code examples 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.
U.S. County custom polygon SAS data sets for SAS Visual Analytics
Download the ZIP file containing tables for Windows environments here.
Download the ZIP file containing tables for LINUX environments here.
Sample SAS Visual Analytics 7.4 report
The SAS Visual Analytics 7.4 report contained in the SAS package file uses the US_COUNTIES1_VALIDATE_STATE SAS data set. Import the SAS package file using SAS Management Console. Import US_COUNTIES1_VALIDATE_STATE to the SAS LASR Analytic Server before opening the report in SAS Visual Analytics.
Download the ZIP file here and extract the VA7.4_USCounties_SampleReport.spk SAS package file.
In some cases, there is a business requirement for the U.S. county ID to be US-00999, where '00' is the state FIPS code and '999' is the county FIPS code. This sample provides the geographic tables necessary to implement U.S. counties using state and county FIPS code in the county ID.
Date Modified: | 2020-03-06 11:45:28 |
Date Created: | 2017-10-06 21:15:32 |
Operating System and Release Information
SAS System | SAS Visual Analytics | Microsoft® Windows® for x64 | 7.4 | | 9.4 TS1M4 | |
Linux for x64 | 7.4 | | 9.4 TS1M4 | |