Page 1 of 1

IN operator in DATASTAGE

Posted: Mon Jun 06, 2011 5:15 am
by karry450
hi Friends


I have a parameter which is having no of values in the parameter from parameterset.

#AAA# having 1,2,3,4,5,6 values( values are different for each run)

I want to use this in constraint as where column A in #AAA#

can any one help how can I acheive this in DS

Thanks

Posted: Mon Jun 06, 2011 5:25 am
by ds_teg
can you please elaborate the requirement ? IN operator can acheived by filter stage .

Posted: Mon Jun 06, 2011 5:35 am
by karry450
Hi

Previously my source( oracle) query was


SELECT * FROM <TABLE> where <COLUMN> A in #PARAMETER#

#PARAMETER# is from my parameterset.

Now my source has been changed to sequence file

I want to filter this some where in datastage job either in transformer stage or any other stage.

can you please help me.

Regards

Posted: Mon Jun 06, 2011 5:54 am
by chulett
There's always the Index() function.

Posted: Mon Jun 06, 2011 6:01 am
by karry450
yeah but in the parameter we donot know how many number and of values are there and also I want to know how we can do the looping for all the set of values .

Posted: Mon Jun 06, 2011 6:08 am
by karry450
And also if I have the input as 1 and the parameter contains 12,11,21 then the index doesnt work

Posted: Mon Jun 06, 2011 6:12 am
by chulett
No "looping" required nor does the size of the list matter. The "trick" to preventing substring matches has been posted here many times: include the delimiter in the search. So, search for ",1," rather than "1". Which also means you'll need to wrap your parameter value in an extra set of delimiters so you can get a proper match on the end values.

Posted: Wed Feb 10, 2016 4:46 am
by vamsi_4a6
chulett wrote:The "trick" to preventing substring matches has been posted here many times: include the delimiter in the search.
i am not able to find any post for the thing highlighed in bold letters and anybody help on this

Posted: Wed Feb 10, 2016 8:03 am
by chulett
One example of several that an exact match search for "substring matches" turned up.