Posted by
J. Kinzer
I created this simple PowerCenter mapplet to format phone numbers. Informatica Developer (IDQ) may have a different or easier way to do it but I wanted something I could use in PowerCenter without the hassle of maintaining a separate object in IDQ and having to import it into PowerCenter. You can alter the mapplet to format other data like postal codes, SSNs, etc.
Download the mapplet and give it a try.
Mapplet Overview
My approach is a simple one, take the phone number, remove all special characters, then reformat the number with dashes as 999-999-9999. This approach allows me to ignore how the phone number comes into the mapplet, for example partially formatted , not formatted or formatted correctly but not how I need it.
The mapplet's input is the telephone number without a country identifier. In addition to the reformatted phone number, the mapplet also outputs:
- a Pattern (example xxx-xxx-xxx) based on the input number (this could be used for a quick/dirty data profiling)
- the phone number parsed into its parts, area code, central office
- the length of the input phone number
Read further to see detail on the mapplet works.
Read more »