IN condtion in Filter stage

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
pdntsap
Premium Member
Premium Member
Posts: 107
Joined: Mon Jul 04, 2011 5:38 pm

IN condtion in Filter stage

Post by pdntsap »

I have a job parameter that is used to as an array/list to store a random number of variables. As an example it can be a three digit code for a list of all countries. I need to use the job parameter in a filter stage to filter the records. I am looking for a function similar to the 'IN' condition that can be used in SQL. It looks like using 'IN' as a predicate in the filter stage is now possible. Any suggestions on implementing the above logic would be of great help.

Thanks.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

This has been answered here already. You can use Index function inside transformer.
pdntsap
Premium Member
Premium Member
Posts: 107
Joined: Mon Jul 04, 2011 5:38 pm

Post by pdntsap »

If I am right, the Index function can be used if all possible values of the list are known before run time. Is my assumption right? If so, what if the list it being populated dynamically and I then need to implement the filter stage based on the generated list?

Thanks.
jcthornton
Premium Member
Premium Member
Posts: 79
Joined: Thu Mar 22, 2007 4:58 pm
Location: USA

Post by jcthornton »

When it is populated should make no difference. Assign the list to the parameter that you want to use, and make sure it is in the right format. There is nothing that would change the evaluation based on when the list is generated (static vs dynamic).
Jack Thornton
----------------
Spectacular achievement is always preceded by spectacular preparation - Robert H. Schuller
pdntsap
Premium Member
Premium Member
Posts: 107
Joined: Mon Jul 04, 2011 5:38 pm

Post by pdntsap »

Thanks guys.

Using an index function in the transformer seems to work. I was reading the forums and looking at ways to use a lookup stage before the filter stage among other things but looks like it will not be needed.
Post Reply