Replace ” with ” in AS/400 string

435 pts.
Tags:
AS/400
As/400 Object
RPGLE
String name
Hi i have a string and want to replace all occurance of " with ".Please let me know how can i accomplish this .

Software/Hardware used:
as400

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you can use embedded SQL in your RPG program, it becomes much easier than the built it RPG methods I’ve seen:

exec sql
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. :)

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    What is the string contained in -- a program variable? ...a column in a table? What language do you want to use? Tom
    125,585 pointsBadges:
    report
  • graybeard52
    If using RPG, you can use the BIF
    %SCANRPL (scanfor : replacewith : targetstring) 
    3,115 pointsBadges:
    report
  • BigKat
    Is that a 7.0 BIF, Graybeard52? Or did they sneak one (that I have been wanting) passed me?
    8,210 pointsBadges:
    report
  • Koohiisan
    @Bigkat Yep, looks like a 7.1 thing. Here
    5,020 pointsBadges:
    report
  • munduuu
    [...] Replace ” with ” in AS/400 string [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following