how to do left join in transformer

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
Jessie
Participant
Posts: 16
Joined: Wed Mar 07, 2007 2:11 pm

how to do left join in transformer

Post by Jessie »

all,

how to do left join or left outer join in transformer?

thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

How about some details about what you are trying to accomplish? Join 'in transformer' with what - hashed file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Jessie
Participant
Posts: 16
Joined: Wed Mar 07, 2007 2:11 pm

Post by Jessie »

Yes, I want to left join with hash file.

use 'transformer' to join a sequence file with 2 hash files. each of the 3 files has some rows that cannot be joined with, and I want all the row from all the 3 files. how to do it?

thanks
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post by vivekgadwal »

Jessie wrote: each of the 3 files has some rows that cannot be joined with, and I want all the row from all the 3 files. how to do it?

thanks
Jessie,

According to my understanding of your problem, why don't you use the Merge stage to join the files. If you need to get the data from 3 files, Use merge stage to combine two files into one and then, may be use another merge stage (in a separate job, of course) and combine the files? Is there a specific reason why you are creating Hash files or is it for this joining purpose itself?
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
Jessie
Participant
Posts: 16
Joined: Wed Mar 07, 2007 2:11 pm

Post by Jessie »

I'm working on 'Merge', waht should I do after 'merge'?
the out put file from 'merge, has file1.key, file2.key
how do I join them to make it one row?

thanks
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post by vivekgadwal »

Jessie wrote: the out put file from 'merge, has file1.key, file2.key
how do I join them to make it one row?

thanks
Jessie,

The way you join is, say, File1.Key and File2.Key need to be joined, in the Outputs page, under Mapping tab, you drag and drop the same in the specified areas where it says "Drag From File Column Names to populate map keys".

Please note that you specify the kind of join you require in the Output page\General Tab.

These steps combined with populating all the other fields in the Outputs page correctly should do the trick :) . I have not used Merge stage as much, but it should work fine. Also, please do refer to the documentation on Merge stage provided along with the tool.

Hope this helps...
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
Jessie
Participant
Posts: 16
Joined: Wed Mar 07, 2007 2:11 pm

Post by Jessie »

here is what I need to do.

file1
Col1 col2 col3 col4
Key1 key2 22 33
Keya keyb 12 23

File 2

Col1 col2 col3 col4
Key1 key2 44 55
keyc keyd 45 54

After merge- the file should looks like

Col1 col2 col3 col4, clo5, col6
Key1 key2 22 33 44 55
keya keyb 12 23
keyc keyd 45 54
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post by vivekgadwal »

Jessie wrote: After merge- the file should looks like

Col1 col2 col3 col4, clo5, col6
Key1 key2 22 33 44 55
keya keyb 12 23
keyc keyd 45 54
Ok... Did you try the way I suggested? Did it work? Let me know.
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: how to do left join in transformer

Post by ray.wurlod »

Jessie wrote:how to do left join or left outer join in transformer?
A lookup from a server Transformer stage is inherently a left outer join; it returns null for all columns on the reference link if the lookup does not succeed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Jessie
Participant
Posts: 16
Joined: Wed Mar 07, 2007 2:11 pm

Post by Jessie »

[quote="vivekgadwal"][quote="Jessie"]
After merge- the file should looks like

Col1 col2 col3 col4, clo5, col6
Key1 key2 22 33 44 55
keya keyb 12 23
keyc keyd 45 54[/quote]

Ok... Did you try the way I suggested? Did it work? Let me know.[/quote]

workingn on it, I'll report to you tomorrow :P
Post Reply