I am having an issue after splitting a query into 2 ODBC stages that the result is now displaying -0.01 instead of -.01.
The same for 0.1 insead of .1
How can I remove the leading zero in front of the negative value as the TRIM is not working ???
Remove leading zero before decimal point
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard. The first question is "why?" The values are identical.
You can probably apply the Fmt() function to achieve what you require - read about this function in on-line Help or in the DataStage BASIC manual.
You can probably apply the Fmt() function to achieve what you require - read about this function in on-line Help or in the DataStage BASIC manual.
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.
Re: Remove leading zero before decimal point
Consider the data type.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Remove leading zero before decimal point
There are no genuine data types in server jobs.SURA wrote:Consider the data type.
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.
I would think all you would have to do is specific the data type as a Decimal and that would take care of your problem.
Other than that you'd have to do some fancy substringing to determine if there is only one character to the left of the decimal and if that character is a zero and if so then substring.
Other than that you'd have to do some fancy substringing to determine if there is only one character to the left of the decimal and if that character is a zero and if so then substring.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: