Pattern Matching in DS PX

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
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Pattern Matching in DS PX

Post by ashwin141 »

Hi
Can anybody guide me in this regard?
How to do pattern matching in DS PX.
Example you have to move all cities which are having "MI" anywhere in their name. i.e %MI%

Substr can work if we are sure where "MI" can occur in the incoming string.
Count will also not work in this case because it will populate both MI% and %MI%.

Any other way of doing it.

Thanks and Regards
Ashwin
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

BASIC Transformer stage?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

There is the Index function which finds the starting character position of a substring. It can be used in a parallel transformer. Not sure if it will work in a filter stage. Constraint: Index(input.mycol, "MI") > 0
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Thanks

Post by ashwin141 »

Thanks Vincent. I got the solution by using count and If Else statement.


Regards
Ashwin
Post Reply