DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
U
Participant



Joined: 17 Apr 2007
Posts: 225
Location: Singapore
Points: 2795

Post Posted: Thu Apr 23, 2015 12:48 am Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: Parallel
OS: Unix
We are seeking to standardize phone numbers, which sometimes have an international direct dialling prefix (001 or 011) as part of a contiguous string.

Is there some way in PAL that we can extract these digits and keep only the remainder?

For example, assuming a wholly numeric token, 00161299556022, the IDD code is 011, the country code is 61, the area code is 2 and the remainder is the line number, and may have variable length (6-8 digits).

We can extract the first three digits using something like [1](1:3) but how can we keep the remainder, the length of which is variable?

Thank you for your time.
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54535
Location: Sydney, Australia
Points: 295717

Post Posted: Thu Apr 23, 2015 3:36 am Reply with quote    Back to top    

The substring operator is generous in that you can specify an ending position beyond the end of the token and it will return only up to the end of the token. In your case, something like the followin ...

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
U
Participant



Joined: 17 Apr 2007
Posts: 225
Location: Singapore
Points: 2795

Post Posted: Thu Apr 23, 2015 9:34 pm Reply with quote    Back to top    

That works well, thank you.

Can something similar be done with other token types (principally & )?
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54535
Location: Sydney, Australia
Points: 295717

Post Posted: Fri May 08, 2015 3:55 pm Reply with quote    Back to top    

Should be OK. Try it.

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours