DB2 equivalent of substr()
Moderators: chulett, rschirm, roy
DB2 equivalent of substr()
Hi,
We have source as flat file and have to load another flat file and have to transform a field which would be picking a substring.
Its like picking a substring in a DB2 table using function substr(column,3,5) , which would give be a substring from character 3 to character 5 of the string.
Do we have a datastage equivalent for this ??
We have source as flat file and have to load another flat file and have to transform a field which would be picking a substring.
Its like picking a substring in a DB2 table using function substr(column,3,5) , which would give be a substring from character 3 to character 5 of the string.
Do we have a datastage equivalent for this ??
Om Prakash
"There are things that are known, and there are things that are unknown, and in between there are doors"
"There are things that are known, and there are things that are unknown, and in between there are doors"
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
The OP needs substring from character 3 to character 5.Krazykoolrohit wrote:In parallel do Columnname[3,5]
should work
Code: Select all
Columnname[3,2]
Sam
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
Re: DB2 equivalent of substr()
Actually the OP contradicts his statement. We all just looked at his substr() exampleopdas wrote:Its like picking a substring in a DB2 table using function substr(column,3,5) , which would give be a substring from character 3 to character 5 of the string.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In a Modify stage numbers are zero-based, so the third character is number 2 and the required function is either substring[2,5](field) or substring[2,3](field) as the other issue is resolved.
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: 34
- Joined: Thu Jul 29, 2004 1:03 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: