NOT IN function 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
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

NOT IN function in datastage

Post by pavan_test »

Hi All,

I am trying to code this in a stage variable in data stage version 8.1

if link.ID not in (40,50,100) then "do this" else if link.ID = link.ID then "do that"
else "remain where you are"

Can someone please let me know how do I accomplish this. I could not find any NOT IN function in etl.

please advise me.

Thanks
Mark
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Set up a stage variable with that list in a dynamic array via its Initial Value. Then you could use a function like Locate() to search the list. You could do something similar with Index() as long as you avoid a substring match, typically handled by the proper use of delimiters.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

NOT IN function in datastage

Post by pavan_test »

Thank you. How do I create a dynamic array in ETL.

Thanks
Mark
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Here I would take a delimited string and then Convert the delimiters to Value Marks:

Code: Select all

Convert(",",@VM,"40,50,100")
Pretty dang sure it should be Value Marks, can't test this right now. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is a parallel job, so linking to Locate() will be ugly.

I'd use a key-only Lookup stage, with the reference input fed by an External Source stage (echo 40,50,100). If the lookup fails then your NOT IN condition is satisfied. You can direct these rows to a reject link and have just those rows selected by that means.
Last edited by ray.wurlod on Mon Jan 18, 2010 3:52 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

D'oh. Dang PX job. :(
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

NOT IN function in datastage

Post by pavan_test »

I am only see partial response. Rest of it is hidden. I am a premium member but still not able to read your complete response.

Thanks
Mark
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Mark, you might want to double-check on your Premium Membership status as it doesn't show you as one - there's an indicator by your name on every post that should show that and it's missing from yours.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

NOT IN function in datastage

Post by pavan_test »

Thank You.

I will send an email to mbership.director@dsxchange.com to find out the status of my membership

Thanks
Mark
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Meanwhile I've opened the status of the reply. Not much of it was hidden in any case.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And now it shows your status as a Premium Member... can you see everything?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You left the first "me" off "membership".
:oops:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply