FULL outer join

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

pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

FULL outer join

Post 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
Pradeep Kumar
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: FULL outer join

Post 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.
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

Hmm...Little more ideas
Pradeep Kumar
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post 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.
Success consists of getting up just one more time than you fall.
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

How to accomplish this task in MERGE STAGE
Pradeep Kumar
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post 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?
Pradeep Kumar
tagnihotri
Participant
Posts: 83
Joined: Sat Oct 28, 2006 6:25 am

Post 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?
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

How to overcome this lookup..Any suggestions plz
Pradeep Kumar
suresh.narasimha
Premium Member
Premium Member
Posts: 81
Joined: Mon Nov 21, 2005 4:17 am
Location: Sydney, Australia
Contact:

FULL Outer Join

Post 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
SURESH NARASIMHA
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

I think a transformer stage cannot get reference input from sequential file
Pradeep Kumar
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post 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.
saikir
Participant
Posts: 92
Joined: Wed Nov 08, 2006 12:25 am
Location: Minneapolis
Contact:

Post 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:)
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post 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
Pradeep Kumar
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

Thanks for all the suggestions
Pradeep Kumar
uppalapati2003
Participant
Posts: 70
Joined: Thu Nov 09, 2006 2:14 am

Post 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
Srini
Post Reply