hash key lookup with an EXTRA key ...

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
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

hash key lookup with an EXTRA key ...

Post by prabu »

Hi DS folks,

i have 2 hash files . one is called streamhash and the other is called referencehash. there are 2 keys in streamhash and 3 keys in referencehash .

i mapped stream K1 to reference K1 and stream K2 to reference K2. i need the K3 in referencehash for some other purpose. so to shut up DS i give a lookup like referencehash.K3 for the Key K3. it shows a red line but compiles alright, when i run , the lookup donest seem to go thr.

i would appreciate a quick response froms someone

example:-

without the extra key in referencehash, it works fine

streamhash K1 , K2
referencehash K1, K2


but when
streamhash K1 , K2
referencehash K1, K2 , K3 and K3.referencehash=K3.referencehash in tranformer , it doesnt work. :oops:


please throw some light

thank you
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Do you have any other columns besides k3 in your first lookup?
If not perhaps a multi value ok k3 at firt a k1 & k2 key columns later normalizing it to generate the new 3 column as key in a new hash file.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It won't work using a Hashed File stage. A Hashed File stage can only perform a lookup against the entire key.

You can set it up to use a UV stage to perform the lookup against a partial key. Search the forum for methods. Search on-line help for multi-row returns from reference inputs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Post by prabu »

[quote="ray.wurlod"]It won't work using a Hashed File stage. A Hashed File stage can only perform a lookup against the entire key.
[/quote]

Hi ray,
thanks a lot for the help. trying to get more clarity , can't i peform something like 1=1 , reference3rdKey=reference3rdKey in the [b]keyExpression[/b] to notify the DS to perform the partial key match.

when i have tried 1=1, it takes the key value to be 1 and the
reference3rdKey=reference3rdKey is always null.

please let me know if this is possible(partial key lookup) using Hashfile stage :oops:

thanks




[/b]
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Post by prabu »

ray.wurlod wrote:It won't work using a Hashed File stage. A Hashed File stage can only perform a lookup against the entire key.
Hi ray,
thanks a lot for the help. trying to get more clarity , can't i peform something like 1=1 , reference3rdKey=reference3rdKey in the keyExpression to notify the DS to perform the partial key match.

when i have tried 1=1, it takes the key value to be 1 and the
reference3rdKey=reference3rdKey is always null.

please let me know if this is possible(partial key lookup) using Hashfile stage :oops:

thanks




[/b]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No.

Only entire key lookup is possible using a Hashed File stage.
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