Page 1 of 1

Converting nullable source to non-nullable result

Posted: Mon Sep 27, 2004 9:17 am
by bobyon
I am receiving the following warning/error for each field in the stream even though I have specified the fields as non-nullable on both the input and output in this aggregator stage as well as all the other stages:

Code: Select all

AggregateToFinPeriod: When checking operator: When binding output interface field "VEND_DISC_AMT" to field "VEND_DISC_AMT": Converting nullable source to non-nullable result; fatal runtime error could occur (use modify operator to specify value to which null should be converted)
Is it possible to eliminate this warning. IF so, how? I read the other posts regarding this error but they didn't seem to exactly match my situation.

I am running DSEE 7.5 on AIX using DB2.

Thanks in Advance

Re: Converting nullable source to non-nullable result

Posted: Mon Sep 27, 2004 9:26 am
by cbrandel
Hi,

if I remember correctly, the columns that You generate (i.e. the result of an AVG() or MAX() within the Aggregator) are always generated nullable. Your only option AFAIK would be to declare them nullable at the output of the aggregator and use a subsequent modify stage with an handle_null() operation.

Hope that helps,
Chris

Posted: Mon Sep 27, 2004 5:02 pm
by gh_amitava
Hi,

You have to handle null when a null value is coming through a not null field. You can use a transformer and use the IsNull() function within the transformer to check the null value in the field. If it is null then handle the null.


Regards
Amitava

Posted: Mon Sep 27, 2004 9:36 pm
by ray.wurlod
That is a server-job answer to a parallel-job question in the parallel-job forum. Please take more care! :roll:

Posted: Tue Sep 28, 2004 3:04 am
by cbrandel
Well, You _can_ use a Transformer and IsNull() in a parallel job. But if You just want to do the NULL handling, it might not be the preferred way to do in PX. Like I said above: modify and handle_null() does the trick.

Regards,
Chris
ray.wurlod wrote:That is a server-job answer to a parallel-job question in the parallel-job forum. Please take more care! :roll:

Posted: Tue Sep 28, 2004 3:35 pm
by bobyon
ok, handling the NULLs is obviously the right solution. I didn't realize that the values coming out of the aggregator were nullable even though I specified non-nullable.

Now, I am attempting to use the modify stage for the first time. I've read the help and am still a little confused....

I decided to use the NullToZero function so I specified

Code: Select all

keep NullToZero(DSLinkname.fieldname)
in a SPECIFICATION entry for each of my aggregated fields on the properties tab of the Stage tab and am getting the following error at run time:

Code: Select all

main_program: Error parsing modify adapter: Expected ';' or ','; got: "("
Expected destination field selector, got: ")"; input: 
keep NullToZero(DSLinkname.fieldname)
;
I obviously am not understanding yet how the Modify Stage works. Can someone enlighten me or point to me to chapter and verse in the manual(s) that will more thoroughly explain how to properly use the stage?

Thanks

Posted: Tue Sep 28, 2004 4:31 pm
by cbrandel
Congratulations! You found a bug in the documentation!
You cannot use NullToZero in a modify stage. This function only exists in a Transformer. Yes, they give this specific example in the documentation and Yes, it is wrong.
The syntax for modify would be:

fieldname = handle_null(fieldname, 0)

Hope that helps,
Chris
bobyon wrote:ok, handling the NULLs is obviously the right solution. I didn't realize that the values coming out of the aggregator were nullable even though I specified non-nullable.

Now, I am attempting to use the modify stage for the first time. I've read the help and am still a little confused....

I decided to use the NullToZero function so I specified

Code: Select all

keep NullToZero(DSLinkname.fieldname)
in a SPECIFICATION entry for each of my aggregated fields on the properties tab of the Stage tab and am getting the following error at run time:

Code: Select all

main_program: Error parsing modify adapter: Expected ';' or ','; got: "("
Expected destination field selector, got: ")"; input: 
keep NullToZero(DSLinkname.fieldname)
;
I obviously am not understanding yet how the Modify Stage works. Can someone enlighten me or point to me to chapter and verse in the manual(s) that will more thoroughly explain how to properly use the stage?

Thanks

Posted: Tue Sep 28, 2004 5:00 pm
by bobyon
Congratulations! You found a bug in the documentation!
Well, don't I feel Proud!

Thanks Chris. That helPs a bunch. I was beginning to think I was incaPable of understanding the Ascential documentation.

Ps my lowercase P has suddenly quit working. :roll: