Does zipcitydistance(zip1, zip2) calculate only 5 digit zip code ?
I need to calculate the distance between two 9 digit zipcodes.
when I ran the 9 digits zipcode to calculate the distance, the log shows error "
NOTE: Invalid argument to function ZIPCITYDISTANCE('006460000','010133140') at line 28 column 13."
data _null_;
distance=zipcitydistance('006460000', '010133140');
put ' distance 8. ' miles';
run;
Can someone share how to calculate the distance between 9 digit zip codes?
Thanks
The function zipcitydistance uses sashelp.zip (as documented) and that dataset contains only the five digit zip codes. So you need another function and data-source to calculate distances. Proc geocode could be used here, you want to read the documentation.
The function zipcitydistance uses sashelp.zip (as documented) and that dataset contains only the five digit zip codes. So you need another function and data-source to calculate distances. Proc geocode could be used here, you want to read the documentation.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.