Page 1 of 2

Carry forward rows that do not match in Hashed file

Posted: Thu Apr 10, 2008 11:01 pm
by dsusersaj
Hi Folks,

I am stuck on an issue. I have to carry forward rows that do not match the look up with the hashed file.

For eg : Input link L1 has columns C1,C2,C3
Hashed file link L2 has column C1

I do a look up on C1 on both and basically want to carry forward the rows that do not match in hashed file. I did isnull(L2.C1)=1 on the constraint to carry forward the rows that do not match. But it doesnt seem to work.

Anyone has any suggesions ?.

I am stuck :!: Its pretty urgent for me.. :cry:


Thanks for your help!

Posted: Fri Apr 11, 2008 12:09 am
by balajisr
IsNull() in constraint will work. Do you get any error?

As an alternative you can use Link.NOTFOUND link variable as constraint.

Posted: Fri Apr 11, 2008 4:42 am
by hamzaqk
put this constraint on the accept link i.e. matching records with the hash file

Code: Select all

NOT(ReferenceLink.NOTFOUND) 
. check the reject row option for the second output link

Posted: Fri Apr 11, 2008 5:43 am
by chulett
What "doesn't seem to work" about it? :?

Posted: Fri Apr 11, 2008 8:22 am
by dsusersaj
The non matching rows are not going out of the link.
Let me try the options you guys mentioned above..Will let you know shortly .

chulett wrote:What "doesn't seem to work" about it? :? ...

Posted: Fri Apr 11, 2008 8:25 am
by dsusersaj
chulett wrote:What "doesn't seem to work" about it? :? ...
The non matching rows are not going out of the link.
Let me try the options you guys mentioned above..Will let you know shortly .

Posted: Fri Apr 11, 2008 8:42 am
by dsusersaj
I have 3 rows that doesnt match the look up and it gets inserted into table.

FYI the look up is the same table I insert into.

Then again I run the job which again inserts the 3 rows once more. The column I am looking at is not a key column. But i do not want this to get inserted if the row is already inserted. I dont know whats wrong.

I tried NOTFOUND option as well. Its also giving me the same result.

Posted: Fri Apr 11, 2008 8:49 am
by kcbland
A lookup is an equi-join style. Remove any contraint. All primary input rows will go to the output link. The lookup result doesn't matter, it never has any bearing on whether a row is output.

Posted: Fri Apr 11, 2008 8:50 am
by dsusersaj
I tried both of these. NOTFOUND and NOTNULL.

The strange thing is first time when i do not have those matching records in table it correctly identifies it as a nonmatch and inserts.
Second time when i run the job with the rows already present in the table, with the NOTFOUND condition on constraint, it again inserts it into the table .Huh???.
I checked the look up table from view data and this column value exists. Also in the input link. It means the look up is happening. But why it is going to the NOTFOUND link??.. :roll:

Any ideas??.

balajisr wrote:IsNull() in constraint will work. Do you get any error?

As an alternative you can use Link.NOTFOUND link variable as constraint.

Posted: Fri Apr 11, 2008 8:53 am
by dsusersaj
Do you mean that ther is no way to capture non matching records?.
Thats exactly what I want.
kcbland wrote:A lookup is an equi-join style. Remove any contraint. All primary input rows will go to the output link. The lookup result doesn't matter, it never has any bearing on whether a row is output. ...

Posted: Fri Apr 11, 2008 8:54 am
by kumar_s
The condition given might not been correct. Is the NotFound the only condition you have in transformer? And C1 is the only field you are looking up after?

Posted: Fri Apr 11, 2008 8:55 am
by dsusersaj
Yes I want to look up only on this column.
kumar_s wrote:The condition given might not been correct. Is the NotFound the only condition you have in transformer? And C1 is the only field you are looking up after? ...

Posted: Fri Apr 11, 2008 9:01 am
by kumar_s
Does the Datatype and the data match happens properly? Have you taken care of the whitespaces on leading and trailing end of both the stream.
On second time, try to pass it on to a Sequential file for testing purpose and check what data you getting from the lookup actually.

Posted: Fri Apr 11, 2008 9:22 am
by dsusersaj
kumar_s wrote:Does the Datatype and the data match happens properly? Have you taken care of the whitespaces on leading and trailing end of both the stream.
On second time, try to pass it on to a Sequential file ...

Yes both streams are integer 22.

In sequenctial file too I get the same value for C1.

Posted: Fri Apr 11, 2008 9:24 am
by kumar_s
Ok, paste the exact constrain that you have mentioned in Transformer.