Comparision of String

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
jayantthakore
Participant
Posts: 42
Joined: Tue Jan 18, 2005 5:48 am

Comparision of String

Post by jayantthakore »

I have to give a constraint which compare for a string pattern "product" in the description and reject the record..........
Is there any method to do it.
i have tried the compare function.its not workin.
I need to search the word product in the whole description any if it is present anywhere then reject the record.

Thanks,
Jayant
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hello there Jayant,

you can use the INDEX function in PX, the syntax is the same as that for a server job, INDEX(BigString,SearchString,Occurence) -> i.e. INDEX('This is a long string with Product numbers in it','Product',1) will return 28 and it will return a 0 when the SearchString does not occur in the BigString.
Raghavendra
Participant
Posts: 147
Joined: Sat Apr 30, 2005 1:23 am
Location: Bangalore,India

Comparision of String

Post by Raghavendra »

Jayant,

U can use INDEX function.
Syntax for Index function is Index (string, substring, instance).
This function will return the starting position of the sub string.
If substring is an empty string, 1 is returned. If substring is a null value, 0 is returned.
jayantthakore
Participant
Posts: 42
Joined: Tue Jan 18, 2005 5:48 am

Post by jayantthakore »

Thanks a lot guys the thing is working absolutely fine now.......
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You may like to convert both the search string and the main string to upper case, in order to perform a case-insensitive search.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply