Page 1 of 1

Null Maping

Posted: Thu Oct 12, 2006 12:38 pm
by sainath
hi
I have seq input file and Lkup file in following way and total no of rows is around 10000


seq file lkup file

1 1
null null
2 2
3 3
null null
4 4

when i do match with not(notfound(lkupfile)) i am getting only rows which are not null .
but i want to return all the rows.
please share your thought
sai

Posted: Thu Oct 12, 2006 12:55 pm
by chulett
A couple of problems:

There's no such thing as a null in a Sequential file, those are empty strings... and not the same thing.

A null can never equal anything, not even another null, so your lookup will never succeed with those values.

I'd suggest substituting another value when you see NULL, something unique that you know won't be found in your data... perhaps a '^' or a '~'. When you build the hashed file and when you read the sequential file, translate any NULLs (or empty strings) into that character. That way your lookup will succeed and all that's left is recognizing a 'NULL' lookup happened and acting accordingly on the output side.

Make sure you put an annotation on the canvas stating what you are doing when you do goofy things like this...