numeric value to trimed
Moderators: chulett, rschirm, roy
numeric value to trimed
Hi,
I have a numeric column in the backend.
values for this looks like below :
00000123
00000456
00000789
in datastage I need to trim to look like below:
123
456
789
can some please let me know if there is function.
Thanks
Ram
I have a numeric column in the backend.
values for this looks like below :
00000123
00000456
00000789
in datastage I need to trim to look like below:
123
456
789
can some please let me know if there is function.
Thanks
Ram
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Try
It certainly works in Server Edition. Not sure about parallel/DSEE.
Code: Select all
Trim(InCol, '0', 'L')
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 57
- Joined: Sat Jun 09, 2007 1:14 am
- Location: chicago
Re: numeric value to trimed
Hi In the transformer u can use the string function called ltrim and apply that on this column may solve ur problem
pls ack me
pls ack me
snt_ds wrote:Hi,
I have a numeric column in the backend.
values for this looks like below :
00000123
00000456
00000789
in datastage I need to trim to look like below:
123
456
789
can some please let me know if there is function.
Thanks
Ram
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
hope we all help each other hand in hand
-
- Participant
- Posts: 57
- Joined: Sat Jun 09, 2007 1:14 am
- Location: chicago
Re: numeric value to trimed
Hi In the transformer u can use the string function called ltrim and apply that on this column may solve ur problem
pls ack me
pls ack me
snt_ds wrote:Hi,
I have a numeric column in the backend.
values for this looks like below :
00000123
00000456
00000789
in datastage I need to trim to look like below:
123
456
789
can some please let me know if there is function.
Thanks
Ram
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
hope we all help each other hand in hand
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What is the data type?
The Data Browser always displays Decimal and Numeric data with leading zeroes, so it may be that the source data do not even have leading zeroes; what you are describing may simply be an artifact of using View Data. And nothing you do except changing the data type to string will affect this.
The leading zeroes are irrelevant, and will load happily into any database target if the column is a numeric data type. If the target is a text file, convert to string (VarChar) and trim the leading zeroes. Do not use Char, as this will be padded with trailing APT_STRING_PADCHAR characters.
The Data Browser always displays Decimal and Numeric data with leading zeroes, so it may be that the source data do not even have leading zeroes; what you are describing may simply be an artifact of using View Data. And nothing you do except changing the data type to string will affect this.
The leading zeroes are irrelevant, and will load happily into any database target if the column is a numeric data type. If the target is a text file, convert to string (VarChar) and trim the leading zeroes. Do not use Char, as this will be padded with trailing APT_STRING_PADCHAR characters.
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: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Re: numeric value to trimed
I'm using version 7.5x2 and ltrim() was not found in the string functions list.karrisuresh wrote:Hi In the transformer u can use the string function called ltrim and apply that on this column may solve ur problem
pls ack me
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: