serach for a particular word

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
cherry
Participant
Posts: 108
Joined: Sun Jul 10, 2005 1:35 am

serach for a particular word

Post by cherry »

Hi All,

I have a field that contains value AAAAAAA BANK OF SA

I will come to know that the particular value is a BANK Name if it has BANK word in that value. How can I search the value to know that it is a BANK. Is thera any function to like FIND to search for a particular word in the value. Please let me know

Thanks in advance..,

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

Post by ArndW »

Code: Select all

Index(In.Column,"BANK",1)
will return a 0 if "BANK" is not in the string, otherwise the location of the first occurence of "BANK" in the string.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Index() will find it. Simple trick to match the whole word is to concatenate your delimiter to each end of both the string to search and the string to search for:

Code: Select all

Index(" ":YourField:" ", " BANK ", 1)
That will match BANK (even at the ends) but not, mmm... BANKRUPTCY, which it would normally for a pure substring search.
-craig

"You can never have too many knives" -- Logan Nine Fingers
cherry
Participant
Posts: 108
Joined: Sun Jul 10, 2005 1:35 am

Post by cherry »

Thanks for all the Support. Its working


Regards
Cherry
Post Reply