Result of a division

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
Peytot
Participant
Posts: 145
Joined: Wed Jun 04, 2003 7:56 am
Location: France

Result of a division

Post by Peytot »

Hi everybody,

In my transform, I try to divise 2 fields :
A Number 9
B Number 9

My targer is C Decimal 5 scale 2

When I check the result, I never have the number after the comma. It always truncate the value.

For exemple:
A = 27
B = 5

C= 5.00 but the right value is 5.40

How can I revolve that?
If you have the answer I will be very interesting.

Thank for your help

Pey
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What are the data types of A and B?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Peytot
Participant
Posts: 145
Joined: Wed Jun 04, 2003 7:56 am
Location: France

Post by Peytot »

A and B are Numbers with lenght 9
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the scale for A and B set to 0? This might (I'm guessing) affect the scale of the result of the division. If so, this could be a bug.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dsxnewbie
Participant
Posts: 1
Joined: Mon Oct 27, 2003 1:52 am

Post by dsxnewbie »

Hi All!


I am also experiencing the same problem whenever I perform any form of arithmetic operation on my numeric data :? . I am using the metadata of the table as I have imported into the table definition. I have several columns defined as NUMBER type hence it's defaulted to DECIMAL(38,0) in the OCI stage.

I was able to do a workaround :D with it in the transformer stage using the string arithmetic operation (SDIV, SMUL). This way I was able to get the decimal place values. However, I need to do aggregation and thus my problem began. There is not much I can do about the aggregator stage thus I am now seeking help :cry: on what approach to take.

I would really appreciate any suggestions. Thanks!


Juvin
Post Reply