Let's start off with a couple address standardisation basics:
- QualityStage is the best tool for this type of work. You can spend weeks and months writing and testing address standardisation routines in DataStage or you could get better quality out of QualityStage in under a week.
- You should not correct the spelling of street names unless you have access to an address matching product certified by your postal authority, or you are using QualityStage address matching jobs.
You've provided a sample address which you standardise in a routine. We could certainly give you code that will split up these type of addresses if every address was in the same format: street number followed by street name followed by street type. The problem is with the hundreds of other address formats including unit numbers, floor numbers, po boxes, shopping centers, property titles, street number ranges, data entry errors etc etc.
If you cannot get QualityStage into your workplace then have a look at all your addresses and take note of the different formats, then design your standardisation routines as a SDLC with time spent on analysis and design first. Try not to write any code until you have worked out how to tackle all the combinations.
I'd just like to reinforce as strongly as possible everything Vincent posted. He was even nice enough to use US spelling for you!
In particular, if you are going to "roll your own" do not stint on planning and design time.
US Postal certification is available to plug in directly to Quality Stage (which is the product formerly known as INTEGRITY from Vality, which was acquired by Ascential). It really will return the investment quickly, compared to a do-it-yourself approach, and won't miss any of the weird scenarios that might be encountered.
And it will handle it when you need to process Cuban and Haitian address formats!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
It seems like the attempted clean-up was a waste and did more harm then good besides waste valuable time!
I was trying to emulate existing code for migration, You didn't think this was my brainstorm?
There is an address process that is run down the line that should handle this.
I already wasted a day on this ( was a lot of other attempted fixes like adding a dash to a non-numeric street number, How would you know? without having the tools you mentioned) and was given the command to move out. :D
But who knows I might wind up back here later.