10-13-2016 08:03 PM
SAS 9.4 TS Level 1M1
I am having some issues with Proc Geocode. I have followed all of the directions for downloading the correct data from SAS Maps Online - since I need data for Alberta Canada, I have downloaded the latest shape files from GeoBase National Road Network (NRN) files and created the required sas files using the Geobase2Geobase.sas macro. Everything installed fine.
After preparing the data input file in the correct format and importing into SAS, I ran the procedure and it crashed on me while making reference to a missing group variable. I am uncertain why this error occurred since I have no variable named group in the data input file and there are none in any data sets that I can see. Any advice would be appreciated.
Here is the code:
method = street /* Street method */
data = geocode.fas_mif_location_ab /* Address data to geocode */
out = geocode.geo_fas_mif_location_ab /* Geocoded output data set */
lookupstreet = geocdeab.alberta_m /* Street lookup data set */
direct = geocdeab.gcdirect_can /* English/French directions */
type = geocdeab.gctype_can /* Canadian street types */
addressvar = address /* street address */
addresscountryvar = country /* Input data set country name var */
addressstatevar = province /* Input data set state name var */
addresscityvar = city /* Input data set city name var */
nozip; /* Disable ZIP method */
Here is the error message:
NOTE: Lookup data set MAPSGFK.WORLD_CITIES used for worldwide geocoding.
ERROR: Variable GROUP not found in GEOCDEAB.GCTYPE_CAN data set.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set GEOCODE.GEO_FAS_MIF_LOCATION_AB may be incomplete. When this step was
stopped there were 0 observations and 0 variables.
WARNING: Data set GEOCODE.GEO_FAS_MIF_LOCATION_AB was not replaced because this step was stopped.
NOTE: PROCEDURE GEOCODE used (Total process time):
real time 0.43 seconds
cpu time 0.03 seconds
10-14-2016 01:55 AM
You wrote "...created the required sas files using the Geobase2Geobase.sas macro.";
I guess, the problem is somwhere in the macro, while creating the file.
If you have another country that works fine, compare variable names of GCTYPE* datasets.
If you saved the log of dataset creation, check it for WARNING / ERROR messages, if any.
As I'm using the SAS University Edition, I have no acces to SAS GRAPH.
10-17-2016 03:18 PM
10-19-2016 11:23 AM
Thanks Darrell. I managed to get it working by importing another file that including the missing "Group" variable but I will definitely redo the data import using the new Geocode macro that you have provided. Once I have done so I will report on any progress.