I have to suppress the leading 0
Example
input output
00000123.2340 => 123.2340
00012345.6700 => 12345.67
12345678.9801 => 12345678.9801
how do I implement this in fmt function?
Thanks,
Eliminating leading 0 in the number
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 43
- Joined: Wed Feb 19, 2003 7:17 am
- Location: France - Paris
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The absolutely fastest way is to add zero to the number.
DataStage arithmetic always returns the shortest possible string.
This will also remove trailing zeroes after the decimal point, which was an unstated part of your requirement but indicated in one of your examples.
DataStage arithmetic always returns the shortest possible string.
This will also remove trailing zeroes after the decimal point, which was an unstated part of your requirement but indicated in one of your examples.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In every computer I've ever encountered (and we're going WAY back here!) addition and subtraction have required fewer machine cycles than multiplication and division. With today's fast processors the difference is unlikely to be noticeable until you get to very large numbers of arithmetic operations (that is, rows processed by DataStage in this case).
In short, YES.
In short, YES.
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.