I know in other non-datastage functions, if you want to search backwards you would specify a negative number. Is this possible with this function?
TIA
index function
Moderators: chulett, rschirm, roy
Not as far as I know but if you test it and find it does it would be interesting to know.
I would approach this by using the Count function to find out how many of the strings there are. If you want the last one use.
I would approach this by using the Count function to find out how many of the strings there are. If you want the last one use.
Code: Select all
Index (string, substring, Count (string, substring))
Regards,
Nick.
Nick.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, the arguments to Index() must be a string, another string and a positive integer. The third argument is an occurrence. You are searching for a substring within a string. The first occurrence of the substring, the second occurrence of the string, and so on. Searching for the -3rd occurrence does not make sense.
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.