I would like to calculate the distance between two columns (about 100 rows) of zipcodes (source zipcodes and destined zipcodes) in SAS university version. I first used the zipcitydistance function, but got an error message saying that "SASHELP.ZIPCODE.DATA" does not exist. I didn't know why, but when I checked the SASHELP library, it was not there. Second, I downloaded manually the recent ZIPCODE.DATA from MAPSONLINE, but found that I actually couldn't save into the SASHELP path becuase no data can be added there. Then I manually merge the ZIPCODE.DATA which has ZIP, x (which I assmed it was latitude)), and y (which I assumed as longitude) with my zipcode pair data. I then used the GEODIST function to calculate the distances and found that SAS calculated some of pairs but not all of them. I selected one of the calculated distances and compared it with the web site tools that calculated the distance between first zipcode and second zipcode and found that the result could not be matched to what the web tool calculations. In addition, for the pair that SAS could not calculate, I still could input on a web tool and found out the distance. My questions are: (1) Does SAS university version have the ZIPCITYDISTANCE function feature? (2) Why did the GEODIST function give results on some pairs but not all? and (3) why did the SAS GEODIST results differ from those from other non-SAS tools? Jeff ===== here are the codes i used: data _null_; dis1 =geodist(-74.009507, 40.712808, -112.016418, 41.219800, 'M'); dis2 =geodist(-93.469244, 41.649151, -93.617602, 41.641599, 'M'); dis3 =geodist(-71.071293, 42.358664, -71.163840, 42.711749, 'M'); put "Distance between zipcodes 10007 and 84401 is " dis1; put "Distance between zipcodes 50009 and 50313 is " dis2; put "Distance between zipcodes 02108 and 01841 is " dis3; run; ==== Note SAS output dis1 and dis2 as blank, and 10.2 miles for dis3. The web tools* gave 1972 miles, 7.7 miles, and 25 miles respectively. *: e.g., https://www.melissadata.com/lookups/zipdistance.asp; or http://www.allplaces.us/dbz.cgi
... View more