BookmarkSubscribeRSS Feed
sp3
Calcite | Level 5 sp3
Calcite | Level 5

Hi,

 

SAS 9.4 TS Level 1M1

X64_7PRO platform

 

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:

 

proc geocode
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 */
run;

 

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

 

Thanks

3 REPLIES 3
Shmuel
Garnet | Level 18

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.

Darrell_sas
SAS Employee

We have a new version of CodeBase2Geocode.sas that should take care of this problem.

Please let us know if this fixes the import.

 

 

sp3
Calcite | Level 5 sp3
Calcite | Level 5

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.

Thanks,

sp3

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1026 views
  • 0 likes
  • 3 in conversation