Cascading Lookups

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
sdfasih
Participant
Posts: 39
Joined: Wed May 24, 2006 7:22 pm

Cascading Lookups

Post by sdfasih »

Hi,
I was wondering if there is a way to do this.I would like to know if I have three Hash Files each having a single column say Col1.
Hash1 Col1 is Source to transformer stage
Hash2 Col1 is lookup to transformer stage
Hash3 Col1 is lookup to transformer stage.
I can do a lookup Hash1 Col1 with Hash2 Col1.Now can I do a lookup Hash2 Col1 with Hash3 Col1?
Thanx in advance.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If the Hash2 and Hash3 has only one column there is no point in doing lookup. And more over, if you are doing a lookup in Hash1 colum1 with Hash2 colum2, you are determining Hash1 as primary stream. So it should be same if you do a Hash2 col1 or Hash1 col1 with Hash3 Col1.
If this doens't get you clarity, pls explain the functionality of your requirement with more example.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Thanks for posting in Server forum, Would you mind deleting the orphan post left out in PX, before some one updates it. You can't delete the the one I had updated though.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Looking at the topic heading Cascading lookup.

I guess you mean something like
Src Col1 to be Lookuped to Col1 (hash1)
Col2 (hash1) to be lookuped to Col2(hash2)

Cascading lookup is possible in the data stage, could be done in two ways
1st: In One transformer
In TX1 Src Col1 to Hash1 Col1
and Hash Col2 to Hash2 Col2
Doing it this way works fine (compile+run) but it shows the derivation in the second lookup column in red (may be its corrected in the latest versions)
2nd: In two transformer one after the other
In TX1 Src Col1 to Hash1 Col1
In TX2 Src+hash1 Col2 to Hash2 Col2
Success consists of getting up just one more time than you fall.
skumar
Participant
Posts: 88
Joined: Thu May 25, 2006 5:11 am
Location: Hyderabad

Post by skumar »

Hi Love,

I tried the first method in your two explanations....I have a doubt here as you told that to keep the link withTX1 Src Col1 to Hash1 Col1 and Hash Col2 to Hash2 Col2. can we put a lookup with the Lookup (Reference link???)Because i tried it with a small example as i never worked on cascading Lookups it was not letting me to pull the Hash1 Col2 to Hash2 Col2 .If you don't mind can you please explain a bit more clear about this......

Cascading lookup is possible in the data stage, could be done in two ways
1st: In One transformer
In TX1 Src Col1 to Hash1 Col1
and Hash Col2 to Hash2 Col2
Doing it this way works fine (compile+run) but it shows the derivation in the second lookup column in red (may be its corrected in the latest versions)

Regards,
skumar.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Lookup can be done only to Main stream to Lookup stream. So to hashed file need to be looked up, it need to be part of Main stream.
In first lookup based on key, drag the column that need to be looked up in concecutive stages in to main stream. So that now it will be part of the main stream. And you can do the look in the Hash2 or what ever.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Cascading lookup CAN be done.

But you can not construct it with the GUI; on the second and subsequent reference key expressions you must type in the qualified name of the return column from the earlier reference input link.

It will remain red, but it will compile and it will work.
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