Replace Strings in DataStage
Trying to find a way to replace strings. e.g. In the string “chocolate”, I want to replace “choc” with “mock”. The convert() function in the transformer only does a character by character replacement.
The most flexible functions are available in the BASIC transformer or the server transformer. Wonder if I can write a logic within my parallel transformer to achieve this effect.
Solution:
Write a Parallel Routine! And where do we lazybones find that routine? DSXchange, where else! Here’s the link to the code: http://www.dsxchange.com/viewtopic.php?t=128696
If you don’t know how to write a parallel routine and use it in a DataStage job, worry not. I will soon create a detailed tutorial or at least post a link to one. Why re-invent the wheel?!
Here’s a link to a nicely written dummy’s guide to parallel routines – How to create shared C code object and use them in datastage parallel routine