how to read special characters in phone number ?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

how to read special characters in phone number ?

Post by developeretl »

Hi ,
I have to read the phone number from the data and find if there are any special charaters. If so then I need it to default it depending on the special characters. Phone number in the data is displayed as "xxx-xxx-xxxx". Can you please guide how to implement the logic to read the entire phone number and default it rather than checking the area code, phone number separately .

Ex: 123-*&^-1234 or @#$-123-1234 . It should read the entire phone number and default it instead of implementing logic for area code and number separatley .
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the hyphens are always present, then something like Num(Convert("-","",InLink.Telephone)) should suffice as the test expression in an If..Then..Else construct.

Or maybe Len(Convert("0123456789-","",InLink.Telephone))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sampath
Participant
Posts: 21
Joined: Tue Apr 05, 2005 2:03 am

Re: how to read special characters in phone number ?

Post by Sampath »

You Can Use NUM function
Regards,
Sampath
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: how to read special characters in phone number ?

Post by ray.wurlod »

Sampath wrote:You Can Use NUM function
Oh. Did I not mention that one? Oh.
:roll:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Re: how to read special characters in phone number ?

Post by developeretl »

Thanks for you help...
Post Reply