The input Data comes as varchar(10) - TERADATA (SOURCE)
col
0000
0009508
03669
08018
08065
0003065
09620
desired output ( i used char(5)) FIXED LENGTH FILE(TARGET)
00000
09508
03669
08018
08065
03065
09620
I have tried this code
if (DSLink3.col) ='0000' Then '00000' else DSLink3.col[3,7]
When the job ran the output is as follows
08018 output comes as 018 (it should be 08018)
09620 ------- 620
08065 ------- 065
0003065 ----- 065
Any inputs on this issue is greatly appreciated.
Thank you all.
Trim Issues while sending Data to Fixed length File
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 46
- Joined: Wed Jun 06, 2007 10:32 am
You should take the right-most 5 characters and then pad on any additional leading zeroes if the original length was less than 5. Are you certain that your 10 digit source will always fit in 5 digits without loss of significant digits?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Right(("00000" : InLink.TheValue), 5)
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: 46
- Joined: Wed Jun 06, 2007 10:32 am