If you can use embedded SQL in your RPG program, it becomes much easier than the built it RPG methods I’ve seen:
set :originalvar = replace(:originalvar,' with ','itke');
That should replace all occurrences of ‘ with ‘ with ‘itke’.
It’s a similar idea to the answer given here, but substituting host variables for fields.
There is a limit on when the SQL set command became available, and I don’t see a mention of what release you are on…so…YMMV. 🙂