GMAP Procedure

Using FIPS Codes and Province Codes

The map area identification variable in some SAS/GRAPH map data sets contain standardized numeric codes. The data sets for the United States contain a variable whose values are Federal Information Processing Standards (FIPS) codes. Traditional data sets for Canada contain standard province codes or census division codes. GfK data sets for Canada contain standard province codes and province names. When you specify a map data set with the GMAP procedure, the map area identification variable values in the map data set must be the same as those used in the response data.
If the map area identification variables in your response data set are state or province names or abbreviations, convert them to FIPS codes or province codes before using the response data set with one of the traditional map data sets supplied by SAS. Conversion might not be necessary if using one of the GfK map data sets because character variables like ID that contain province codes, for example, might already match the identification variables in your response data set. U.S. FIPS Codes lists the FIPS codes for the United States and Canadian Province Codes lists the standard codes for Canadian provinces.
Note: Alternatively, you can convert the FIPS code or province codes in your traditional map data set to match the names in your response data.
U.S. FIPS Codes
FIPS code
State
FIPS code
State
01
Alabama
30
Montana
02
Alaska
31
Nebraska
04
Arizona
32
Nevada
05
Arkansas
33
New Hampshire
06
California
34
New Jersey
08
Colorado
35
New Mexico
09
Connecticut
36
New York
10
Delaware
37
North Carolina
11
District of Columbia
38
North Dakota
12
Florida
39
Ohio
13
Georgia
40
Oklahoma
15
Hawaii
41
Oregon
16
Idaho
42
Pennsylvania
17
Illinois
44
Rhode Island
18
Indiana
45
South Carolina
19
Iowa
46
South Dakota
20
Kansas
47
Tennessee
21
Kentucky
48
Texas
22
Louisiana
49
Utah
23
Maine
50
Vermont
24
Maryland
51
Virginia
25
Massachusetts
53
Washington
26
Michigan
54
West Virginia
27
Minnesota
55
Wisconsin
28
Mississippi
56
Wyoming
29
Missouri
72
Puerto Rico
Canadian Province Codes
Province code
Province
10
Newfoundland
11
Prince Edward Island
12
Nova Scotia
13
New Brunswick
24
Quebec
35
Ontario
46
Manitoba
47
Saskatchewan
48
Alberta
59
British Columbia
60
Yukon
61
Northwest Territories
Note: The id-variables are numeric in traditional but character in GfK Canadian map data sets.
The MAPS.CNTYNAME data set contains a cross-reference of names and FIPS codes for all counties in the United States. The MAPS.CANCENS data set contains a cross-reference of census district names and codes for Canadian provinces.
Base SAS software provides several functions that convert state names to FIPS codes and vice versa. The following table lists these functions and a brief description of each. See SAS Functions and CALL Routines: Reference for more information.
FIPS and Postal Code Functions
Function
Description
STFIPS
Converts state postal code to FIPS state code
STNAME
Converts state postal code to state name in upper case
STNAMEL
Converts state postal code to state name in mixed case
FIPNAME
Converts FIPS code to state name in upper case
FIPNAMEL
Converts FIPS code to state name in mixed case
FIPSTATE
Converts FIPS code to state postal code