Page 1 of 1

Search for a specific text from a record

Posted: Thu Jan 12, 2012 8:51 pm
by phanikumar
Hi

I have a scenario where in I need to filter out all the records if I found the specific text any where in the record.

for example I need to filter out all the records where they contain a value IBM.If IBM is part of any where within the record I need to filter out that record.

Can some one please tell me what function has to be used in order to achieve this.

Regards

Kumar

Posted: Thu Jan 12, 2012 9:25 pm
by pandeesh
It has been discussed already here.
Please search for Like operator.

Posted: Thu Jan 12, 2012 9:31 pm
by chulett
Index()

Posted: Thu Jan 12, 2012 10:38 pm
by Kryt0n
I'm assuming the string to filter out can be in any column, in which case I would test out pre-processing with a grep against what datastage itself can do

Posted: Thu Jan 12, 2012 10:50 pm
by chulett
True, if we're talking about a flat file source you can leverage something like 'grep' in the Filter option as well.

Posted: Thu Jan 12, 2012 10:51 pm
by qt_ky
The grep command does have some useful options like -v and -i that you may be able to use, especially if you're dealing with a typical text file.

Without using grep, if you need to check all columns, you could create a throw-away column that concatenates all the columns and then use the Index() function in a Transformer constraint.

Another way is to read each entire record from a file into a single char or varchar column, do the Index() check, and then columnize the record.