my i/p like this
column
001
102
1300
00102
required o/p like this
column
1
102
13
102
how to achive this one
how to eliminate left & right side zero's
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 138
- Joined: Wed Jul 16, 2008 9:51 pm
- Location: Kolkata
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What are your data types?
Trim() function has options to strip from either or both sides.
Convert() would not be appropriate because it would also take out embedded zeroes.
Trim() function has options to strip from either or both sides.
Convert() would not be appropriate because it would also take out embedded zeroes.
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:
These functions do not exist in the Transformer stage.antonyraj.deva wrote:TRIML and TRIMT functions in a transformer with "0" specified as the character to be removed.
--Tony
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: 138
- Joined: Wed Jul 16, 2008 9:51 pm
- Location: Kolkata
Re: how to elimenate left & right side zero's
make two stage variablesds_dwh wrote:my i/p like this
column
001
102
1300
00102
required o/p like this
column
1
102
13
102
how to achive this one
first would remove leading zeros and second trailing:
stage1 = trim(input,"0","L")
stage2 = trim(stage1,"0","R")
Here stage 2 is going to be your output variable.
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Re: how to elimenate left & right side zero's
You don't need 2 fuctions to do that, just use trim with option 'B'.agpt wrote: make two stage variables
first would remove leading zeros and second trailing:
stage1 = trim(input,"0","L")
stage2 = trim(stage1,"0","R")
Here stage 2 is going to be your output variable.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
Re: how to elimenate left & right side zero's
true thanks Priya.....priyadarshikunal wrote:You don't need 2 fuctions to do that, just use trim with option 'B'.agpt wrote: make two stage variables
first would remove leading zeros and second trailing:
stage1 = trim(input,"0","L")
stage2 = trim(stage1,"0","R")
Here stage 2 is going to be your output variable.