SAS Institute. The Power to Know

SAS/GIS(R) 9.2: Spatial Data and Procedure Guide

space
Previous Page | Next Page

Batch Geocoding

%GCBATCH Macro Statement

The %GCBATCH macro accepts the following information:

  • the name of the address data set to geocode

  • the variable names in the address data set

  • the name of the map entry

  • the libref in which to store geocoding data sets, and whether they should be re-created

  • the name of the ZIP code centroids data set

  • the names of any additional polygonal composites to add to the address data set.

The %GCBATCH macro has the following general form:

%GCBATCH(
<GLIB=geocoding-library,>
<ZIPD=ZIP-centroids-data-set,>
GEOD=address-data-set,
<NV=name-var,>
AV=address-var,
CV=city-var,
<SV=state-var,>
<ZV=ZIP-var,>
<P4V=ZIP+4-var,>
MNAME=map-entry,
<PV=area-composite-list,>
<NEWDATA=new-data-value> );

where

AV=address-var

specifies the name of the variable that stores the street address in the address data set that you want to geocode. This parameter is required.

CV=city-var

specifies the name of the variable that stores the city name portion of the address in the address data set that you want to geocode. This parameter is required.

GEOD=address-data-set

specifies the address data set that you want to geocode. This parameter is required.

GLIB=geocoding-library

specifies the libref for the SAS library where all of the sorted and summarized chains, nodes, and details data sets that are created for the geocoding process are stored. This parameter is optional.

Note:   The SAS library that you specify for the GLIB= argument should be on a volume that has a large amount of free space because the geocoding data sets might be quite large. Also, to take full advantage of the geocoding facility, you should specify a permanent SAS library. The default for this variable is WORK, but data sets in the WORK library are deleted when the SAS session is terminated, so the geocoding data sets will be lost. If geocoding data sets already exist in the specified library at the start of the geocoding process, the geocoding facility checks their creation dates against the creation date of the chains data set. The geocoding data sets will be re-created only if the chains data set has a more recent creation date. The first time that you geocode with a particular chains data set, the process will take considerably longer because these geocoding data sets are being created, sorted, and indexed. Subsequent geocoding times, however, will be much faster as long as the chains data set has not been modified.   [cautionend]

MNAME=map-entry

specifies the name of the GISMAP entry for the SAS/GIS spatial database that you are using for geocoding. The geocoding process uses the projection information in the map entry to ensure that the X and Y coordinates that are returned for the address will be in the same coordinate system as the spatial data for the map. The MNAME= argument should use the form libref.catalog-name.entry-name. This parameter is required.

NEWDATA=YES|NO

specifies whether the geocoding data sets are re-created. The default is NEWDATA=NO. If you set NEWDATA=NO, the geocoding facility searches the SAS library that you specified with the GLIB macro variable for geocode data sets that were created for the spatial entry. The geocoding facility checks the creation date of existing geocode data sets against the creation date of the spatial entry. If the creation date of the geocode data sets is more recent than the creation dates of the spatial entry, the geocoding facility uses the geocode data sets. Otherwise it creates new geocode data sets.

Use NEWDATA=YES to force the geocoding facility to build new versions of the geocoding data sets. You should specify NEWDATA=YES if the existing geocoding data sets were created with an earlier version of SAS/GIS software. This parameter is optional.

NV=name-var

specifies the name of the variable that stores the name portion of the address in the address data set that you want to geocode.

This parameter is optional.

PV=area-composite-list

specifies the list of polygonal (area) composite values that you want added as variables to the address data set along with the X and Y coordinates of the address. By default, no other variables are added. Use spaces to separate composite names in the list. For example, the following specification adds the county and census tract and block values along with the address coordinates:

pv=county tract block,
This parameter is optional.
P4V=ZIP+4-var

specifies the name of the variable that stores ZIP+4 postal codes in the address data set that you want to geocode.

This parameter is not required, but the accuracy of the geocoding process might be reduced if you omit it.

SV=state-var

specifies the name of the variable that stores the state name portion of the address in the address data set you want to geocode.

This parameter is not required, but the accuracy of the geocoding process might be reduced if you omit it.

ZIPD=ZIP-centroids-data-set

specifies a data set that contains the coordinates of the centers of ZIP code zones. (If an address includes a ZIP code and the street address cannot be matched, the geocoding facility supplies the ZIP code centroid coordinate instead of the address coordinate.) The default is ZIPD=SASHELP.ZIPCODE, which specifies the SASHELP.ZIPCODE data set that is supplied with SAS/GIS software. This parameter is optional.

ZV=ZIP-var

specifies the name of the variable that stores the ZIP code portion of the address in the address data set that you want to geocode.

This parameter is not required, but the accuracy of the geocoding process might be reduced if you omit it.

space
Previous Page | Next Page | Top of Page