Division by Zero

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
sgubba
Participant
Posts: 30
Joined: Wed Apr 16, 2008 11:06 am

Division by Zero

Post by sgubba »

Hi all,

In one of my job I got this warning message

analyzeAndPrepare:divisor is 0.

I suppressed the warning and ran the job

The next job which is a load job is failing with
Unable to insert a record into the table due to ORA-01722: invalid number


Is this error because of the divison by 0 warning

What values Datastage assigns when Divison by zero happens
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Division by zero is undefined. Therefore it does not make sense to ask what value gets assigned. DataStage (correctly) throws an exception. It's up to you to check the divisior if there's any chance of it being zero.

Code: Select all

If Qty = 0 Then 0 Else TotalPrice / Qty
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sgubba
Participant
Posts: 30
Joined: Wed Apr 16, 2008 11:06 am

Post by sgubba »

Thanks Ray

I will certainly handle that division by zero

My question is will it assign a non numeric character

I want to know if this column is the issue or
there is another column that causing the issue of inserting non numeric to a numeric column

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

Post by chulett »

More than likely that is the issue. Fix the division error and you'll see.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can generate any value that's legal for the data type of the target column.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply