Converting nullable source to non-nullable result

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bobyon
Premium Member
Premium Member
Posts: 200
Joined: Tue Mar 02, 2004 10:25 am
Location: Salisbury, NC

Converting nullable source to non-nullable result

Post 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
Bob
cbrandel
Participant
Posts: 6
Joined: Thu Sep 16, 2004 6:03 am
Location: Germany

Re: Converting nullable source to non-nullable result

Post 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
gh_amitava
Participant
Posts: 75
Joined: Tue May 13, 2003 4:14 am
Location: California
Contact:

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is a server-job answer to a parallel-job question in the parallel-job forum. Please take more care! :roll:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
cbrandel
Participant
Posts: 6
Joined: Thu Sep 16, 2004 6:03 am
Location: Germany

Post 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:
bobyon
Premium Member
Premium Member
Posts: 200
Joined: Tue Mar 02, 2004 10:25 am
Location: Salisbury, NC

Post 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
Bob
cbrandel
Participant
Posts: 6
Joined: Thu Sep 16, 2004 6:03 am
Location: Germany

Post 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
bobyon
Premium Member
Premium Member
Posts: 200
Joined: Tue Mar 02, 2004 10:25 am
Location: Salisbury, NC

Post 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:
Bob
Post Reply