String manipulation in COBOL/400

140 pts.
Tags:
COBOL
COBOL/400
String manipulation
I want to replacing 1 character in a String with 1 or more Characters in COBOL/400. How can i perform this??

Answer Wiki

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

Simply use the INSPECT statement:

INSPECT ID-1 CONVERTING “ABCD” TO “XYZX” AFTER QUOTE BEFORE “#”.

ID-1 Before: AC”AEBDFBCD#AB”D
ID-1 After: AC”XEYXFYZX#AB”D

If I remember correctly, I’ve replaced one character with multiple characters.

Discuss This Question:  

 
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.

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.

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

Following

Share this item with your network: