Hi All,
I have Amount with Varchar(21) and it's getting data as 11302.06 and 0.00 in two records and I'm converting it to Decimal (21,5). I'm using a function
StringToDecimal(SvValueAddedAmt,"trunc_zero")
but I'm getting data as 0000000000011302.06000 and 0000000000000000.00000
Is there a way that I can get output as 11302.06000 and 0.00000
Thanks,
Somaraju
Decimal issue
Moderators: chulett, rschirm, roy
Decimal issue
somaraju
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not if your data type is Decimal. DataStage shows leading and trailing zeroes to confirm that precision and scale have been handled correctly.
You can remove these by changing the data type to VarChar.
You can remove these by changing the data type to VarChar.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Of course you'd have it look like that!
Here's what to do: in the stage before that stage which got the varchar type, it's either numeric or decimal, correct?
Now, in that stage, clear the precision or limit it.
If the stage before it also have the type of varchar, keep tracking back the stages till you hit one that is NOT varchar and is decimal/numeic.
Happy DataStaging
Here's what to do: in the stage before that stage which got the varchar type, it's either numeric or decimal, correct?
Now, in that stage, clear the precision or limit it.
If the stage before it also have the type of varchar, keep tracking back the stages till you hit one that is NOT varchar and is decimal/numeic.
Happy DataStaging