Doubt in Lookup

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Doubt in Lookup

Post by somu_june »

Hi,

Iam using a job that is performing a lookup function with db2 stage API.

I have a file and there are 24 records and DB2 table has 4 records and when I am performing lookup based on key columms in lookup stage Iam getting all the 24 records but I want only 4 records that is from the table db2.



Thanks

Somaraju
somaraju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This is a bit confusing. If your master input has 24 rows then going through a lookup should also bring back 24 rows - with the looked-up new columns having values or nulls depending on your keys.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You are trying to do a Left outter join. The values that match the Lookuptable will only be outputted or if you pass the link from the source to the target also, then the matched and non-matching columns both would be in the result.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Dsguru,

I have defined a leftouterjoin and Iam haning Ch,Cu and Date as key columm and I am getting only 14 rows out of 24

date key (it is there in file and table),date1(fromfile it is only in file)
ch,cu,date,date1
R,1,2,1
O,1,3,2
R,2,2,1
R,1,3,2

Iam getting only above two only from output and Iam not getting the bottom two


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

Post by ray.wurlod »

Which link is "left" and which is "right"? Maybe you need a right outer 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If your lookup file has the Date key only then it would give only the first two records. Not the last two.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply