how to do conditional lookup.............

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
ajay.prakash03
Participant
Posts: 54
Joined: Mon May 28, 2007 12:41 am
Location: Chennai

how to do conditional lookup.............

Post by ajay.prakash03 »

what is conditional lookup,
Scenario would be some thing like below.

I have a input file, where I can get either product or something else as input, now if input is product I have to do a product lookup , if its something else, then I have to do a different lookup, which I am not able to do in datastage, what I am able to do is for all. I am not able to do only a selective lookup.
U can suggest in Server also.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: how to do conditional lookup.............

Post by sachin1 »

hello if i have understood your requirement well then, i think you should know what all lookup's you need like product...or something else. then...

in server jobs you can have

your input file ---- transformer(constraints) ---> output(1,2...3).

in transformer stage you can put constraints and get values needed in output, then these output and other references could be used for lookup.

if this is not your requirement, please elaborate more on it so that we can give you a solution.
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

You mean to say if it is product then lookup with product, if it is product ID then lookup with product ID. Now are they in the same column in the main link and the product and product ID are coming in different column in the reference link? If this is the case then you cannot do it in the same lookup. You will have to filter them into two links and use two lookups. And then probably join them back into a single stream.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

You could use a filter to differentiate between your data stream - one with product, one with something different. The product data stream does a lookup against the product table, the other data stream does whatever lookup it needs.

Code: Select all

                  product lookup -> ...
input -> filter <
                  other lookup -> ...
Brad.
Post Reply