Using the results of a lookup in another downstream lookup

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Using the results of a lookup in another downstream lookup

Post by sbass1 »

Hmmm, how to simplify my problem description???

Say I've got incoming data like so (NK=natural key, SK=surrogate key):

NK1, NK2, NK3

And hashed files used for lookups (reference links) like so:

NK1 --> SK1
NK2 --> SK2

And a composite key in my final lookup:

NK3, SK1, SK2

IOW, my incoming file contains 3 natural keys, I have to do two lookups, then a third lookup on NK3 plus the two SK's previously looked up.

I've set the link order in the transformer stage properly, and set the lookups for NK1 and NK2 based on the incoming data from the primary link.

But, I can't seem to drag the results of the "upstream" lookups as the key expression of the final lookup.

If the upstream lookup has succeeded (or even if it hasn't), and the result is available "in memory" for writing to the output, then why can't I also use it as input to the downstream lookup???

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

Post by chulett »

It really wants you to add a second transformer to do the third lookup. However, while you can't drag the key reference, you can simply type it in. Yes, it will stay red but will work if you've done everything correctly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

Just a curiousity question: is this the same in DS 8.x? IMO, if it doesn't allow me to drag the upstream key reference, but allows me to type it in, but it still stays red, but in fact works, then it's a design bug. It may work as designed, but the design is crap :? However I do understand that there may be internal, technical reasons why this would be hard to fix.

Regardless, thanks heaps for the tip. I really didn't want to have to add additional transformations (my actual problem definition is a lot more complex).
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I don't mind using more than one Transformer. You can always hide them in a local container. Call it "Magic_Happens".
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