HASH FILE 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
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

HASH FILE LOOKUPS

Post by ririr »

Guys

Here is another situation. I have created a Hashfile lookup in one of my mappings.

In the source master query, the following are the columns:

OLDCOLA, OLDCOLB, OLDCOLC, NEWCOLA, NEWCOLB, NEWCOLC, I was able to manage the OLD AND NEW VALUES BY APPLYING TRIGGERS AT THE DATABASE LEVEL

OLDCOLA AND NEWCOLA are the KEYS.


THE HASHFILE IS JOINED WITH THE SOURCE MASTER QUERY TO LOAD THE CODE VALUE FROM HASH FILE LOOKUP INTO MASTER TARGET TABLE.

NOW, FOR LOADING THE HISTORY TABLE I AM USING THE OLDCOLA, OLDCOLB AND OLDCOLC VALUES TO POPULATE HISTORY RECORDS.

QUESTION ?

CAN I USE THE SAME HASFILE AND JOIN THE SOURCE NEWCOLA, OLDCOLA to get the CODE VALUE for OLD AND NEW.

I know it can be done if I have multiple instances of same hash file. But, is it possible to apply coditions in one hashfile and get old and new CODE VALUES.

Any feedback is appreciated!

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

Post by ray.wurlod »

You can probably do what you want. What is in the hashed file(s), and which column is the key column? What information do you want to return from the hashed file? Without knowing these things it is impossible to give you an answer.
Using a hashed file on a reference input link is almost the same as using any stage type, except that the only possible "join" is an equi-join on the hashed file key. If that key is not found, DataStage sets the value on every column to NULL (so it behaves like a left outer join; you can constraint the output of the Transformer stage so that keys found and keys not found can be directed to different output links, or discarded, thereby mimicking an inner join).
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