Hi,
does anyone know how to strip leading zeros from numeric fields.
ie. 021121234 - > 21121234
thanks
how to strip leading 0's from numeric data
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can perform arithmetic on it. For example add zero to it. DataStage returns the shortest possible string when arithmetic results are presented.
Other approaches use the Trim() function, the Fmt() function, or the Iconv() function, not to mention reinventing the wheel by writing your own routine.
But arithmetic, or Sainath's solution (loading into an Integer column will automatically remove the leading zero), are the efficient mechanisms.
Other approaches use the Trim() function, the Fmt() function, or the Iconv() function, not to mention reinventing the wheel by writing your own routine.
But arithmetic, or Sainath's solution (loading into an Integer column will automatically remove the leading zero), are the efficient mechanisms.
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.