Page 1 of 1

In the seq file, will there be any loss of decimal values?

Posted: Wed Jan 12, 2011 2:26 am
by suresh_dsx
Hi,

We are extracting data from db2 and using modify stage converting into string then finally loading into sequential file.
Job Design:

Db2 stage -->Modify stage -->sequential file stage

Source column name : Cust_amount
Datatype : Decimal (20,2)
Target column name : Cust_amount
Datatype : Varchar(25)

Modify stage specification:

Code: Select all

Cust_amount:string[max=25] = string_from_decimal [suppress_zero](Cust_amount)
Sample data

Sum of the column @ database level

1223454545903.30

Sum of the column @ file level (After loading into sequential file)

1223454545901.50

we observed loss of data at sum of the column not at the row level. we have get this value after loading into sequential file (1223454545903.30) but we are getting different values.

Tried the following other options

1. db2 stage --> seq file stage (we are seeing some difference)


Any greatly appricated.

Thanks
Suresh

Re: In the seq file, will there be any loss of decimal value

Posted: Wed Jan 12, 2011 7:45 am
by chulett
suresh_dsx wrote:we observed loss of data at sum of the column not at the row level.
This implies an issue with however you are doing the "sum" of the file data... can you explain how you are doing that?

Posted: Wed Jan 12, 2011 11:30 pm
by suresh_dsx
First loading into a comma separated file then moving the file into windows through winscp then open with excel and sum of all the values (Format: number( -1234.10 with 2 decimal places)

Manually checking the total sum of the file.