Page 1 of 1

decimal field from database to sequential stage

Posted: Fri Jul 30, 2010 1:19 am
by jyothisdasms
Hi,

I have to load a decimal field(14) from database(DB2) to a sequential file.

There is no change needed in length and datatype.

When i am trying to do this i am getting leading zeros and an extracharacter '_' at the end in sequential file.

For ex:

Input-100000

i am getting the o/p as - 00000000100000_

Can you guys help me to figure it out.

Posted: Fri Jul 30, 2010 1:30 am
by ray.wurlod
No idea where the underscore is coming from, unless you have somehow managed to declare your decimal placeholder as "_".

The leading non-significant zeroes are normal for Decimal data type - they indicate that precision is being handled properly. You can get rid of these by converting to a VarChar data type and removing the leading zeroes with a Trim() function.