Page 1 of 1

NOTFOUND function dont work in DS 6

Posted: Wed Feb 16, 2005 8:48 pm
by Fersca
Could it be possible that the link.NOTFOUND function have a bug in datastage 6, I was all the week traing to make it works , I tested it in every way I imagied, but its still not working. The problem is the following, when I make a relation between to tables and I ask if the relation was null using link.NOTFOUND in the constraint of the destination table but it retrives me all the rows when its supossend not to do that, it works if I use the function isnull(), where am I commiting the mistake?
greeting,
Fer

Posted: Wed Feb 16, 2005 9:40 pm
by susanm
It may depend on the stage type before the reference link.

I have experienced the linkname.NOTFOUND property to not work on 7.1 when the reference link was coming from an Oracle OCI stage.

Like you, I ended up using the IsNull() function to test if the reference was found or not.

Re: NOTFOUND function dont work in DS 6

Posted: Wed Feb 16, 2005 9:42 pm
by chulett
Fersca wrote:Could it be possible that the link.NOTFOUND function have a bug in datastage 6
Yes, it's certainly not out of the realm of possibility.

Back in the day, before the NOTFOUND was added, the only way to check the success of a hash lookup was the IsNull function. When NOTFOUND was first introduced, I started trying to use it and found to my horror that it didn't always work! :shock: So, I've gone back to my old ways and still pretty much always check a key field for null to test for success or failure.

Now, I'm sure it works perfectly fine now, however old habits die hard and I see no burning need to switch.

You might want to post your exact 6.x version of DataStage and see if there is a higher maintenance release available. Either that or upgrade into the 7.x family... preferably 7.5.

Posted: Thu Feb 17, 2005 3:00 am
by peterbaun
Hi -

As susanm writes I too have found that link.NOTFOUND doesn't work when used with a lookup to an ODBC- or DB2 Stage - it only seems to work when the lookup comes from a hashfile. Use the IsNull() function as suggested.

Regards
Peter