Page 1 of 1

Pattern Matching in DS PX

Posted: Thu Sep 08, 2005 12:29 am
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

Posted: Thu Sep 08, 2005 1:38 am
by ray.wurlod
BASIC Transformer stage?

Posted: Thu Sep 08, 2005 5:22 pm
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

Thanks

Posted: Thu Sep 08, 2005 11:46 pm
by ashwin141
Thanks Vincent. I got the solution by using count and If Else statement.


Regards
Ashwin