Hi,
I have a input file .txt, which has a column QT of integer type of length 6.
The input data for QT is like
888
3456
12
And i want to map column QT to QTY with leading zeros and the target column QTY should also be Integer type of length 6
My desired ouput should be like
000888
003456
000012
Can any one help for this?
Thanks in advance,
dodda
leading zeros infront
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Integers do not have leading zeroes. Integers are stored in a binary format. If you want leading zeroes then your target field needs to be a string. In that case an appropriate expression to use is something like
Code: Select all
Right("000000" : InLink.QT, 6)
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: leading zeros infront
HI,
Ray's point is correct. U have to change the datatype to varchar/char.
and have to use following function in transformer derivation of that column
Str('0', 6-Len(Trim(DSLink.columnname))):DSLink.columnname
Ray's point is correct. U have to change the datatype to varchar/char.
and have to use following function in transformer derivation of that column
Str('0', 6-Len(Trim(DSLink.columnname))):DSLink.columnname
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: