finding delimiters

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

finding delimiters

Post by nani0907 »

hi ,

i need to find the delimiters in the value. and populate that delimilter in another column.How to acheive this?

Thanks in advance
thanks n regards
nani
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Errr... can you give an example or two?
-craig

"You can never have too many knives" -- Logan Nine Fingers
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

hi ,

In column A ,i am getting values like below

Coulm A columnB
1;2;3 ;

1|2|4 |

1~5~7 ~

So i column B i need to populate the delimiter .
thanks n regards
nani
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

hi ,

In column A ,i am getting values like below

Coulm A columnB
1;2;3 ;

1|2|4 |

1~5~7 ~

So in column B i need to populate the delimiter
thanks n regards
nani
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

If it is numeric, you can locate non-numeric character to be your delimiter.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Much easier in server job or using BASIC Transformer stage in parallel job.

Code: Select all

MatchField(InLink.TheColumn, "0N1X0N0X", 2)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

In both server and parallel, you can do

Code: Select all

Convert('0123456789+-.','',yourField)[1, 1]
If you numbers include space and E, include them in convert.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why don't you throw us a bone before people go too far down the 'solutions' path? :?

Are your values (other than the delimiters, of course) always/exclusively numeric? Will there only be one distinct delimiter in any given field and thus a single value always goes into B or can they be mixed and you need to put a distinct list in B?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply