Hi,
I have got a decimal field EXT_AMOUNT DECIMAL 11,3. I get the values as 00000000045.22 whereas I need them as 45.22. It is a file load.
Please let me know how to do it.....I have already tried a lot......
Regards
Arnie.
remove the zeros from the left of a decimal field
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
Re: remove the zeros from the left of a decimal field
Hi,arnie_nits wrote:Hi,
I have got a decimal field EXT_AMOUNT DECIMAL 11,3. I get the values as 00000000045.22 whereas I need them as 45.22. It is a file load.
Please let me know how to do it.....I have already tried a lot......
Regards
Arnie.
You can use Fabs function in Trasnformer.
Regards,
Ram
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Re: remove the zeros from the left of a decimal field
Hey !! this is new function in transformer for version 8X????SURA wrote:Hi,arnie_nits wrote:Hi,
I have got a decimal field EXT_AMOUNT DECIMAL 11,3. I get the values as 00000000045.22 whereas I need them as 45.22. It is a file load.
Please let me know how to do it.....I have already tried a lot......
Regards
Arnie.
You can use Fabs function in Trasnformer.
Regards,
Ram
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Fabs() function
No, it's a server job function (DataStage BASIC). It can be used in the BASIC Transformer stage in parallel jobs.
In parallel jobs use the Abs() function, which returns a dfloat result, to remove the sign from a number. To remove leading zeroes the target field must be a string of some kind, and you use DecimalToString() or DfloatToStringNoExp() with appropriate arguments. Once you have a string you can Trim() leading zeroes.
In parallel jobs use the Abs() function, which returns a dfloat result, to remove the sign from a number. To remove leading zeroes the target field must be a string of some kind, and you use DecimalToString() or DfloatToStringNoExp() with appropriate arguments. Once you have a string you can Trim() leading zeroes.
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.
-
- Premium Member
- Posts: 45
- Joined: Fri Nov 07, 2008 12:22 pm
Thanks
Maveric wrote:Write the data into the file as Varchar. Convert the data type in a transformer to using DecimalToString() function with suppress_zeros option.
Thanks Maveric!
Your tip did the trick for me!!
-Hiral
Thanks,
Hiral Chauhan
Hiral Chauhan