hey guys
i have job seqfile-> tranformer stage ->target
source data
"----John---"
"----paul----"
output is
John
paul
i created a routine for that and i used in tranformer stage.i am getting the result.
but i want a single function to get the output in transformer stage.(i dont want to use routine )
thank you
string function
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Trim() function is the one you want. Specify the "-" character as the second argument of Trim(), and the third argument is a single character code specifying from where you want them removed. You can learn all the options by reviewing on-line help or from the DataStage BASIC manual.
A second possibility, if you want to discard all "-" characters, is to use the Convert() function to convert them all to "".
Others are likely to suggest the Ereplace() function, but this is not as efficient as Convert() when performing individual character conversion.
A second possibility, if you want to discard all "-" characters, is to use the Convert() function to convert them all to "".
Others are likely to suggest the Ereplace() function, but this is not as efficient as Convert() when performing individual character conversion.
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:
Code: Select all
Convert("s","z",Ereplace(Ereplace(Ereplace("Those cwazy Others, whadda they know?","Th","D",-1,0),"th","dd",1,1),"th","d",1,1))
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.