How can I search a string for XYZ and replace with spaces

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

turash
Premium Member
Premium Member
Posts: 51
Joined: Fri Apr 06, 2007 10:09 am
Location: Edison, NJ

Post by turash »

Very interesting to know ereplace() exists in datastage
jdmiceli wrote:Came up with another option that should do what you want:

use eReplace() instead. It would look something like this:
eReplace(<fieldname,linkname,etc>, "<String to replace>", "<replacement values>", [# of instances to replace], [occurance to start from]) - the last two are optional.

So using what you gave as an example, it might look like this in the transformer's derivation field for that field:
eReplace(link.field, "attn: Richard", " ")

I would think though that you would not want a space for each letter replaced as that would pad the text of the field, moving it to the right. Just a thought.
Post Reply