Decimal values Getting rounded

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
aceflyer
Participant
Posts: 7
Joined: Sun Aug 07, 2005 11:26 am

Decimal values Getting rounded

Post by aceflyer »

Hi
In my source table i have a column "quantity" which has data type "real" having length as 7 . say for example one value is 12.76378682376 , when i load it directly into the database table its getting loaded fine . but i have to follow a few steps before so i am loading it into a dataset and then in the next step into the database
the problem in this is when i am loading it into a dataset the value is getting rounded to 3 decimal places eg:12.764 for the above input value
i have played with different data types to get the full value but couldnt

Please advice over this

Thanks
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Hav u defined the precision scale in the dataset?

Sam
aceflyer
Participant
Posts: 7
Joined: Sun Aug 07, 2005 11:26 am

Post by aceflyer »

Yes i have tried all the possible data types with precision , without precision
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Could you just tell us what length and precision have you defined in the dataset. you mentioned length as 7 in your initial post and i think thats y you are getting this.

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

Post by ray.wurlod »

Is it really rounding into the Data Set, or is it merely that the data browser (View Data) that is doing the rounding? If you move the data from the Data Set into a table or text file, are the data complete?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
aceflyer
Participant
Posts: 7
Joined: Sun Aug 07, 2005 11:26 am

Post by aceflyer »

Hi Ray
Its not just the view data , but i am loading the data in the dataset into the target table , the target data for that clolumn in being rounded to 3 decimal places

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

Post by ray.wurlod »

Can you post the record schema for the Data Set?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
aceflyer
Participant
Posts: 7
Joined: Sun Aug 07, 2005 11:26 am

Post by aceflyer »

record
( Part_ID: string[max=255];
Cust_ID: string[max=50];
Cust_ASM: string[max=50];
Cust_GSM: string[max=50];
UNIT: sfloat;
REVENUE: sfloat;
UNIT_EXP: sfloat;
CREATE_DATE: timestamp;
CURRENT_FLAG: string[max=1];
T_Date: timestamp;
)


The source column Quantity is getting divided into 3 columns Unit,Revenue,Unit_Exp
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What is the datatype in target? Is it the view data which gives you the truncation or the target or the both?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

how did u resolved?

Post by scorpion »

Hi aceflyer,

Have u got the solution for this,if u remeber just tell me how did u achieve this?since i am having same issue..
Thanx&Regards
scorpion
savis
Premium Member
Premium Member
Posts: 27
Joined: Tue Apr 15, 2008 11:06 pm

Post by savis »

Can you try this way?

Multiply the field by 10000 (say x) or some other value and try to store in some datatype.

when you reterive, divide the field by the same number (x) .

I do agree that this will have negative impact on your performance?

If you find any other better solution, do post it..

Thanks,
Savis
Post Reply