%GCBATCH Macro Statement

The %GCBATCH macro sets the input parameters for the batch geocoding program. The 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 library in which to store geocoding data sets, and whether new copies of the data sets are created
  • the name of an alternate ZIP code centroids data set that is used instead of SASHELP.ZIPCODE
  • the names of any additional polygonal composites to add to the address data set.
The %GCBATCH macro has the following general form. The elements within the %GCBATCH macro can appear in any order, but they must be separated by commas.
%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=YES|NO> );
where
AV=address-var
specifies the name of the variable that stores the complete street address in the address data set that you want to geocode. This includes the house number, street name, and street type (for example, 3922 Oak Avenue). 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 are 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 are created again only if the chains data set has a more recent creation date. The first time you geocode with a particular chains data set, the process takes considerably longer because these geocoding data sets are being created, sorted, and indexed. Subsequent geocoding times, however, are much faster as long as the parent chains data set has not been modified.
MNAME=map-entry
specifies the name of the GISMAP entry for the SAS/GIS spatial database (the chains, nodes, and details data sets) 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 lookup data sets are created again if they already exist. 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 or province 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 software. Updated data sets are available from the SAS Maps Online area at http://support.sas.com. 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.