Not NUll Comparision

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
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Not NUll Comparision

Post by nkln@you »

I do have a look up in Job which has 5 keys. I need to compare 4 keys in hash file with that of 4 fields in source. The 5th field in hash file should be not be Null. How can I give Not Null in the derivation field for that 5th Filed inside Transformer. If we want to cpmpare it with Null , we can use @NULL. I need to make sure that the field in Hash file is not null.
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

NONE of the key columns in a hashed file can be null.

If the reference key expression is null, the lookup is not attempted. You can prove this using the Debugger.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

Ray,

My aim is actually not to make sure the 5th field is NOT NULL.My aim is to compare only 4 fields of Hash file with source. I dont want to compare 5th filed with source.Since 5th filed is also a key in hash file, it has to be compared with some value, but for my requiremnet I dont want.

Even I cannot create that hash file with only 4 keys, because that file is used by other jobs.

So, is there any solution to compare only 4 fields and making 5th field as dummy.
Aim high
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Do a lookup against the hashed file via UV stage. With the hashed file, it has to be lookedup with all the keys and all the keys need to match to grab a record.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

I am new to UV stage. What additional advantage I have if I use UV stage instead of OCI stage. For Both UV and ORA, we need to mention table names, columns, where clause etc.
Aim high
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

UV stage will read your hashed file. OCI stage cannot do that.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

NONE of the key columns in a hashed file can be null.

If the reference key expression is null, the lookup is not attempted. You can prove this using the Debugger.
Hi Ray,

Can we trim the Key field before writing to hashed file. And while doing the lookup, can we do lookup with empty string like ''?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Zero-length string is valid as a key value. NULL is not.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sun rays
Charter Member
Charter Member
Posts: 57
Joined: Wed Jun 08, 2005 3:35 pm
Location: Denver, CO

Post by sun rays »

nkln@you wrote:Ray,

My aim is actually not to make sure the 5th field is NOT NULL.My aim is to compare only 4 fields of Hash file with source. I dont want to compare 5th filed with source.Since 5th filed is also a key in hash file, it has to be compared with some value, but for my requiremnet I dont want.

Even I cannot create that hash file with only 4 keys, because that file is used by other jobs.

So, is there any solution to compare only 4 fields and making 5th field as dummy.
Just for this job purpose, you can create another hashed file with 4 keys instead of modifying the original file, and the fith key from source can be checked for null value in the transformer.
Post Reply