Join in hash file

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
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Join in hash file

Post by kab123 »

Hi,

I am trying to do a lookup using a hash file..
I have ColA in seq file and ColA in Hash file(both files same structures)...I wanted to know how can I get a ColA data from hashfile if there is no match found in seq file but we have in hash file...(basically a outer Join)..
I tried to use merge stage, but having problems with It..Warning !!! "Construct Hash file failed"

Thanks
nchincholikar
Participant
Posts: 21
Joined: Sun Jul 18, 2004 11:32 pm

Post by nchincholikar »

Hi,
For this You can not create a hash file as a driving file to bring all records(i.e.Outer join).You need to do this in 2 pass,first create a hash file from sequential file and then this newly created hash file can be used as a driving file.

Regards,
Narendra
anupam
Participant
Posts: 172
Joined: Fri Apr 04, 2003 10:51 pm
Location: India

Post by anupam »

In the contratint you have to write that wherever the HashFile(ColA) <> SeqFile(ColA). And u will get all the rows from Hash file which are not present in the Sequential File.
----------------
Rgds,
Anupam
----------------
The future is not something we enter. The future is something we create.
rhettbutlernc
Charter Member
Charter Member
Posts: 14
Joined: Thu Dec 04, 2003 11:34 am

Post by rhettbutlernc »

How can I do a full outer join using Hash. I need to get the ColA value if it is present either in the driving file or the look-up file.

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

Post by ray.wurlod »

Not possible using a Hashed File stage. This uses the primary key, the whole primary key, and nothing but the primary key.

How would you do it if one table were Oracle and the other DB2? You can do the same with anything and a hashed file, if you access the hashed file via a UV 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