Removing missing or null warnings

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jackdaw
Premium Member
Premium Member
Posts: 16
Joined: Fri Jul 06, 2007 5:32 am

Removing missing or null warnings

Post by jackdaw »

Hi

I get a gazillion warnings in Director log - <Missing or NULL> (<Missing or NULL>): <Missing or NULL> - which I'd like to get rid of so that I can run with 50 warnings limit. The job has several standard transforms looking up values on a hash file to return another code. There don't appear to be missing (key or otherwise) values on the hash file. What is the most likely cause ?

Cheers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... that *is* the most likely cause, writing a null key to a hashed file. However, we can't really tell because you've just posted a snippet from the error. It would help greatly if you posted an example of the actual error so we can see it in its entirety.

Also please clarify - you are only doing hashed lookups in the job, no hashed writes? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
jackdaw
Premium Member
Premium Member
Posts: 16
Joined: Fri Jul 06, 2007 5:32 am

Post by jackdaw »

Hi

Please excuse - the error in its entirety in the Director log is, unfortunately, as posted. Presumably there's some other way of detailing the error then ? :oops:

And there are no writes to the hash file; it's just used as a lookup.

chulett wrote:Well... that *is* the most likely cause, writing a null key to a hashed file. However, we can't really tell because you've just posted a snippet from the error. It would help greatly if you posted an example of the actual error so we can see it in its entirety.

Also please clarify - you are only doing hashed lookups in the job, no hashed writes? :?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Doing a lookup using a null key will generate the same error.
jackdaw
Premium Member
Premium Member
Posts: 16
Joined: Fri Jul 06, 2007 5:32 am

Post by jackdaw »

OK, thanks. So I've tried this - in the key expression field for the hash file I've done a test e.g:

Code: Select all

if Not(IsNull(slk_input_file_dara.locode))  then trim(slk_input_file_dara.locode) else 99998
so that a dummy value is used as the key value if it would otherwise be missing. Then in the transform I test if the looked up value is not found (which it won't be) and if so set the field which should otherwise have a lookup value returned to it to a bucket value. Is there a more effective way of dealing with this type of error ?

Hope that makes sense !
ArndW wrote:Doing a lookup using a null key will generate the same error.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, that would be a perfectly fine solution. And sorry for the brain fart, forgot the null lookup would generate the same error. Too early here, not enough coffee. :wink:

ps. I'd document this in an annotation on the canvas.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jackdaw
Premium Member
Premium Member
Posts: 16
Joined: Fri Jul 06, 2007 5:32 am

Post by jackdaw »

Many thanks.
chulett wrote:No, that would be a perfectly fine solution. And sorry for the brain fart, forgot the null lookup would generate the same error. Too early here, not enough coffee. :wink:

ps. I'd document this in an annotation on the canvas.
jackdaw
Premium Member
Premium Member
Posts: 16
Joined: Fri Jul 06, 2007 5:32 am

Post by jackdaw »

Many thanks. Probably too much coffee here !
chulett wrote:No, that would be a perfectly fine solution. And sorry for the brain fart, forgot the null lookup would generate the same error. Too early here, not enough coffee. :wink:

ps. I'd document this in an annotation on the canvas.
jackdaw
Premium Member
Premium Member
Posts: 16
Joined: Fri Jul 06, 2007 5:32 am

Post by jackdaw »

An update:

Finally tracked down source of warnings to a stage variable expression which used an input column with null values in some rows. All the hash lookup stuff was a red herring.

Issue resolved, thanks.

Cheers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... that explains the abbreviated error message, me thinks. I screwed up yesterday and generated several of my own, writing to a hashed file with a null key - those are a wee bit more verbose and obvious as to the source:

Code: Select all

Job..Stage.Link: ds_uvput() - Write failed for record id '<Missing or NULL>' 
Time to mark this as Resolved.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

Can we not try to replace a key, which can have null values with '' and make a lookup with ''

Because I have a situation where I have two keys A,B
and one of them (B) could be null sometimes. So can I try to replace the null with '' and load it into the key.

So that I can use A, TRIM(B) as lookup

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is that a question? If so, then, yes. Sure. You can choose any value you like to represent null that wouldn't otherwise appear in your data as long as you handle it consistently on both 'sides'. I've done that with '*' or '~' from what I recall.

Make sure you annotate this on the canvas. :wink:
-craig

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