BookmarkSubscribeRSS Feed
sekarpc
Calcite | Level 5

I have addresses in one field. I want to break it apart as door number, street, city and zip. The addresses are not uniform; some have just spaces between the various parts and some have commas. Can somebody give me an idea of how to go about it efficiently?

2 REPLIES 2
SASKiwi
PROC Star

Depending on how many addresses you have, their variability and the countries involved this could be a complex and long exercise. We use SAS Data Quality (also known as DataFlux) to do exactly this. It contains a parser to evaluate every address and split it into its component parts - no coding is required. It also caters for country-specific variations and you can fine-tune the process by tweaking the product's Quality Knowledge Base. The software also standardizes the address layouts and you can create address match keys to join to other address sources. You can even use it for geocoding the location of the addresses.

 

Personally I wouldn't even attempt this since I have access to an automated, superior alternative but I hope this demonstrates that a DIY approach will take a lot of work. 

 

  

A_Swoosh
Quartz | Level 8

Like @SASKiwi  explained, it's a tedious task to work through. There is a previous thread that addresses this and even made the same suggestion as @SASKiwihttps://communities.sas.com/t5/SAS-Procedures/Address-cleaning/td-p/521206. The article references a paper found here that may be useful: https://analytics.ncsu.edu/sesug/2008/CC-028.pdf

 

strip and prxchange functions are going to be your friend.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 982 views
  • 2 likes
  • 3 in conversation