rows getting dropped from look up 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
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

rows getting dropped from look up stage

Post by Hope »

my source is teradata table. my target is also a teradata table. I have to do lookup get the related records where there is key match. My source has 3 rows.and my look up table has 3 rows.
source data
State sourcename Records
MI xxx 100
WI yyy 200
CA zzz 555

LookupData
State sourcename Loaddate
WI xxx 2007-06-07
MI yyy 2005-09-06
CA zzz 2007-06-07

I am joining these two tables using a lookup stage using 2 key columns(State and sourcename).The job gets aborted with an error "Failed a key lookup for record".When there is a key match my job gets aborted. The same logic worked for a different job.This jobs gets aborted.am I missing anything?
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Re: rows getting dropped from look up stage

Post by Yuan_Edward »

Did you notice that the first two records of the source don't match the lookup? You can change the action for the Lookup Failure condition if you want the job to contine.
Hope wrote:my source is teradata table. my target is also a teradata table. I have to do lookup get the related records where there is key match. My source has 3 rows.and my look up table has 3 rows.
source data
State sourcename Records
MI xxx 100
WI yyy 200
CA zzz 555

LookupData
State sourcename Loaddate
WI xxx 2007-06-07
MI yyy 2005-09-06
CA zzz 2007-06-07

I am joining these two tables using a lookup stage using 2 key columns(State and sourcename).The job gets aborted with an error "Failed a key lookup for record".When there is a key match my job gets aborted. The same logic worked for a different job.This jobs gets aborted.am I missing anything?
Edward Yuan
Zhang Bo
Participant
Posts: 15
Joined: Sun Jul 15, 2007 9:22 pm

Re: rows getting dropped from look up stage

Post by Zhang Bo »

that's because you set constraints in lookup stage if lookup fail,then fail,that's the default option,you can choose others,
MaDFroG
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

I am sorry This is how my data is.
sourcename state load_dt
xxxx MI 2007-06-07
xxxx WI 2007-06-08
xxxx CA 2007-09-07


sourcename state Recordscount
xxxx CA 100
xxxx MI 200
xxxx WI 200

sourcename and state are keys.
does records in the State column need to match order?.
prashkvrk
Participant
Posts: 15
Joined: Tue Nov 21, 2006 1:17 am
Location: Bangalore,India

Post by prashkvrk »

again the look up wont happen because data is not matching for the key "state". However if u remove the constraint look up failure the job wont abort !
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

If I take the constraint out the job gives me the warning "Field Recordscount from input dataset '0' is NULL. Record dropped." I thought the lookup stage will check for the key match from the source xxxx MI 2007-06-07
and from the reference xxxx MI 200 and
gives me output xxxx MI 2007-06-07 200.
Post Reply