Problem in aggregating decimal value

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
anujgarg
Participant
Posts: 38
Joined: Sun Jun 26, 2005 11:17 pm

Problem in aggregating decimal value

Post by anujgarg »

Hi all.

I am doing sum of columns decimal(15,2) But i am getting warning

AG_GLData,0: APT_Decimal::operator=: the source decimal has even precision, but non-zero in the leading nybble, or is too large for the destination decimal.

For that i have tried changing target length to decimal(17,2) also decimal(19,4).But this doesn't worked.It looks as if there is problem in putting the decimal value in target field after all processing as it is fixed width field.So what should i do for that case.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Re: Problem in aggregating decimal value

Post by Ultramundane »

I tried too. It doesn't work. I would call this a bug as it lets you select the target decimal length by selecting the subtype "Decimal output". However, when you change this (at least in my case) the job completes successfully and nothing gets loaded. Always nice.

I was able to get to work by using a convoluted modify stage (at least as far as lock of documention is concerned and mapping capabilities via drag-drop like other stages) to modify the incoming decimal from a decimal(15,2) to a decimal(19,2) before sending to aggregate. In aggregate stage I selected subtype "Decimal Output" for the SUM option and enterered (19,2) as (8,2) for some reason seems to be a default that does not work. That worked.

To use modify, basically input the same schema you currently have in the input of the stage into the output of the stage and for the columns causing issues that are decimal(15,2) change to decimal(19,2) in the output (just output).

In stage, properites, enter a specification for each column to be changed to a decimal(19,2).

Just doing,
mydec1=mydec1
mydec2=mydec2

seemed to work for me.
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

Where is the source data coming from?
What values are being summed to cause this problem?
What is the answer that you expect in the output?

I assume you are doing this in an aggregator rather than a transformer?
Post Reply