BookmarkSubscribeRSS Feed
rprincey
Calcite | Level 5

Hi,

 

I've run proc geocode on a dataset containing address, city, state, zip but it only returned latitudes in the high negatives (ie, down in antartica).   The code ran successfully and showed a high percentage of matches at the street level, but the latitudes are wrong.

 

Is there a known bug with the procedure?

 

Thanks!

 

16 proc geocode /* Invoke geocoding procedure */
17 method=street /* Specify geocoding method */
18 data=members_transz /* Input data set of addresses */
19 out=members_geo /* Output data set with X/Y values */
20 addressvar=address2
21 addresszipvar=zip
22 addressstatevar=state
23 addresscityvar=city
24 lookupstreet=lookup.usm
25 ;
26 run;

NOTE: Address data set BOB.IMAX_MEMBERS_DRVS_TRANSZ has 24,957,395 observations.

_________________ Geocoding Progress _____________________
_____ Completed ____ _____________ Time _______________
Percent Obs Current Remaining Completion
0% 0 15:07:31 -- --
1% 249,574 15:07:45 00:23:29 15:31:15
2% 499,148 15:08:00 00:23:29 15:31:29
3% 748,722 15:15:36 04:21:28 19:37:04
4% 998,296 15:21:51 05:43:53 21:05:44
5% 1,247,870 15:25:31 05:41:53 21:07:24
10% 2,495,740 15:37:07 04:26:21 20:03:28
15% 3,743,610 15:46:22 03:40:11 19:26:34
20% 4,991,480 15:55:05 03:10:17 19:05:23
25% 6,239,349 16:03:33 02:48:07 18:51:41
30% 7,487,219 16:11:57 02:30:19 18:42:17
35% 8,735,089 16:20:14 02:15:03 18:35:18
40% 9,982,959 16:28:31 02:01:30 18:30:02
45% 11,230,828 16:36:49 01:49:08 18:25:58
50% 12,478,698 16:45:02 01:37:31 18:22:33
55% 13,726,568 16:53:18 01:26:33 18:19:52
60% 14,974,438 17:01:36 01:16:03 18:17:40
65% 16,222,307 17:09:57 01:05:55 18:15:53
70% 17,470,177 17:18:17 00:56:02 18:14:19
75% 18,718,047 17:26:37 00:46:21 18:12:59
80% 19,965,917 17:34:57 00:36:51 18:11:49
85% 21,213,786 17:43:13 00:27:28 18:10:42
90% 22,461,656 17:51:30 00:18:13 18:09:43
95% 23,709,526 17:59:43 00:09:03 18:08:47
100% 24,957,395 18:07:44 00:00:00 --

_________ Geocoding Summary _____________________________
Address data: BOB.IMAX_MEMBERS_DRVS_TRANSZ
Output data: WORK.IMAX_MEMBERS_DRVS_GEO
STREET lookup data: LOOKUP.USM
CITY lookup data: MAPSGFK.USCITY_ALL
ZIP lookup data: SASHELP.ZIPCODE
Geocoding method: Street level
Run date: 27Nov2017
Obs processed: 24,957,395
Elapsed time: 03:00:13
Obs per minute: 138,477
Street matches: 21,568,915
ZIP matches: 3,324,278
City matches: 0
Not matched: 64,202
_________

6 REPLIES 6
ballardw
Super User

I would say the most likely place to look is at the values in you lookup dataset. Your lookup set may be projected for a specific use and not returning actual latitude and longitude values.

 

 

Reeza
Super User

Not that I'm aware of...have you checked what method was used for those particular records, ie the match/lookup type I believe it's called.. 

 

Is it possible to post a few addresses - or similar type addresses that we can replicate the issue with?

And what version of SAS are you using and did you update your maps data from here;

http://support.sas.com/rnd/datavisualization/mapsonline/html/geocode.html

rprincey
Calcite | Level 5

Thanks for the replies - the issue is resolved.

Reeza
Super User

@rprincey What was the issue?

rprincey
Calcite | Level 5
I unfortunately don't know. When I first put the data in map (tableau), it all showed up in Antartica.
Then I re-ran it and it worked.
The one thing that may have caused the problem was that, in a data step, I originally copied the lat/long field to new variables for naming sake:
latitude=x;
longitude=y;
Maybe that caused the issue?

ballardw
Super User

@rprincey wrote:
I unfortunately don't know. When I first put the data in map (tableau), it all showed up in Antartica.
Then I re-ran it and it worked.
The one thing that may have caused the problem was that, in a data step, I originally copied the lat/long field to new variables for naming sake:
latitude=x;
longitude=y;
Maybe that caused the issue?


Very likely, longitude is the line that runs north/south on a map and the value is used for the direction east/west: i.e. X coordinate in mapping by default. So you transposed the values from east/west to north south. You should have had a largish number of points not map at all as the values from -90 to -180 wouldn't have a usable coordinate pair for mapping.

 

If you look in the Sashelp.zipcode file you'll notice that the variable named X is labeled Longitude.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 1804 views
  • 0 likes
  • 3 in conversation