IN operator in DATASTAGE

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
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

IN operator in DATASTAGE

Post 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
ds_teg
Premium Member
Premium Member
Posts: 51
Joined: Tue Aug 11, 2009 6:53 am
Location: Chicago

Post by ds_teg »

can you please elaborate the requirement ? IN operator can acheived by filter stage .
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's always the Index() function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post 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 .
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post by karry450 »

And also if I have the input as 1 and the parameter contains 12,11,21 then the index doesnt work
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

One example of several that an exact match search for "substring matches" turned up.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply