Null Maping

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

Null Maping

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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...
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply