Page 1 of 2

FULL outer join

Posted: Wed Nov 08, 2006 8:59 pm
by pradkumar
How to perform a full outer join in Datastage Server jobs.

I am having two tables. One table is populated from flat files. One table is ERP(SAP) table. The ERP table is having keycodes and descriptions. The normal table is having some extra keycodes. I want to perform a full outer join.

How to accomplish this

Re: FULL outer join

Posted: Wed Nov 08, 2006 9:07 pm
by DeepakCorning
What about using a Link Merge stage? Of course not directly...but if you put a little thought in it the link merger state should help you out perfectly.

Posted: Wed Nov 08, 2006 9:16 pm
by pradkumar
Hmm...Little more ideas

Posted: Wed Nov 08, 2006 9:55 pm
by loveojha2
Or left outer joins doing two times,

Something like

Code: Select all

              Table
               |
SrcFile ---->Trx----->Tgt

             Srcfile
              |
Table------>Trx------->Tgt
if you don't want to use the link merge stage.

Posted: Wed Nov 08, 2006 11:36 pm
by pradkumar
How to accomplish this task in MERGE STAGE

Posted: Wed Nov 08, 2006 11:45 pm
by pradkumar
I tried using the previous solution

My transformer stage is getting primary input as well as refernce input from tables. It is not reading anything from reference table. The job is not giving any errors. What might be the reason?

Posted: Wed Nov 08, 2006 11:56 pm
by tagnihotri
The lookup must be failing i.e no rows are retrieved.

pradkumar wrote:I tried using the previous solution

My transformer stage is getting primary input as well as refernce input from tables. It is not reading anything from reference table. The job is not giving any errors. What might be the reason?

Posted: Wed Nov 08, 2006 11:59 pm
by pradkumar
How to overcome this lookup..Any suggestions plz

FULL Outer Join

Posted: Thu Nov 09, 2006 12:15 am
by suresh.narasimha
HI,

Take the two inputs into two sequential files and try Complete Set.

Hope this could serve the purpose.

Regards,
Suresh N

Posted: Thu Nov 09, 2006 12:18 am
by pradkumar
I think a transformer stage cannot get reference input from sequential file

Posted: Thu Nov 09, 2006 12:22 am
by ShaneMuir
pradkumar wrote:I think a transformer stage cannot get reference input from sequential file
I'm pretty sure Suresh is saying to use the sequential files in the merge stage, not as a referential link to a transformer.

The merge stage does not have any input links per se. You specify the two sequential files you wish to use and have output links only.

Posted: Thu Nov 09, 2006 12:44 am
by saikir
Hey Using the merge stage you can perform as many as eight type of joins on files. Read below:

Type of Join Operation Description
Pure Inner Join A AND B Merges only those rows with the same key values in both input files.
Complete Set A OR B Merges all rows from both files.
Right and Left Only A NOR B Merges all rows from both files except those rows with the same key values.
Left Outer Join A Merges all rows from the first file (A) with rows from the second file (B) with the same key value.
Right Outer Join B Merges all rows from the second file (B) with rows from the first file (A) with the same key value.
Left Only A NOT B Merges all rows from the first file except rows with the same key value in the second file (B).
Right Only B NOT A Merges all rows from the second file except rows with the same key value in the first file (A).

If, this is not what you are lookig for or i have answered incorrectly then sorry:)

Posted: Thu Nov 09, 2006 12:53 am
by pradkumar
I was able to accomplish it. I did not trim of one key column. Now i am having one basic doubt. My Target is a sequential file. I developed the following in a single job and executed it. How do I see the output. One is reading x rows and other is reading y rows.
How do I see the output of outer join. Do I need to buid two separate jobs?
Table
|
SrcFile ---->Trx----->Tgt

Srcfile
|
Table------>Trx------->Tgt

Posted: Thu Nov 09, 2006 12:53 am
by pradkumar
Thanks for all the suggestions

Posted: Thu Nov 09, 2006 2:40 am
by uppalapati2003
pradkumar wrote:How to overcome this lookup..Any suggestions plz

Hi PradKumar,
I think V can use HashFile as a refference lookup and v can match Both primary key links(from hash file key and source file key) in transformer stage.
Regard`s
Shrini