Problem while using LookUp stage and Join Stage

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
dsuser_cai
Premium Member
Premium Member
Posts: 151
Joined: Fri Feb 13, 2009 4:19 pm

Problem while using LookUp stage and Join Stage

Post by dsuser_cai »

Hi

I have some problem when I use the LookUp Stage and Join stage. Following are the details:
Source Oracle 10, target: Oracle 10.
Im extracting data from 1 oracle table using an ODBC stage, then i use a look up stage to look up with another table (i use ODBCstage).
Source query:
select S.col1, S.col2 from source_table

Lookup query
select L.col1, L.col2 from look_up_table
im joining based on col1. data type is varchar2(10).

in target i need to take S.col1, S.col2, L.col2

when i apply this condition inthe look up stage i get a error
"Lookup_166,1: Failed a keylookup for record."
but i tried to write a query in oracle and i was able to pulle all the requied rows. I used trim function to trim the columns, still no go.

Then I tried to use a join stage. I used hash partition and sorted on the key column. Now i got a different out put.

Code: Select all

col1 col2 l.col2
1     v     100
2     u     0
3     w     101
in this row 1 and row3 are correct but row 2 should have a value and not 0. im able to get this if i run the query in oracle.,

i do not get any warning message apart from NLS warning message. Can anybody help me to fix this. right now im using oracle to query to insert into the table and that works fine, but i need to implement this in DS.
Thanks
Karthick
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Run it on a single node, that will ensure a partitioning issue isn't taking place.

If still no join then re-check your "2"... try outputing both to a flat file or do a hex dump of them. Constrain your two inputs to just row "2"
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The lookup stage should work correctly, regardless of the source data partitioning. The join does depend upon correct partitioning; you should partition on your join key to ensure that all rows are in the correct partition.
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Its better to use the option 'entire' in the lookup stage. This helps to have all the data looked up irrespective of the partition methodology

Regards
Sreeni
HariK
Participant
Posts: 68
Joined: Thu May 17, 2007 1:50 am

Re: Problem while using LookUp stage and Join Stage

Post by HariK »

Remove the fail if lookup not found property and check if the result is same as the result of the join. then it most probably would be data problem.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your "Lookup Failed" rule in the Lookup stage is probably set to its default value, which is "Fail" (= abort the job). Change the rule according to your requirements - there are three other possibilities.
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