COBOL: Substitution in string

We have a formatted screen system where a driver program passes the locations of a list of files that called programs may be using. It will look something like this:

/{number of characters varies}/DATA/MASTERFILE

Because of the size of some files we will be splitting older records into a history file "HMASTERFILE" to save space.

We will need substitute "DATA/" with "DATA/H" before using that path/filename to open that file. Does COBOL have a simple way of doing that?

TIA

Hi.

I don't use COBOL, but a quick glance at the results of a search for COBOL statement syntax yielded a possibility for a solution: COBOL: Language Reference

String

The STRING is used to concatenate (join) multiple fields or literals into one field. It replaces a series of MOVEs. ...

Excerpt from the linked page, q.v..

Best wishes ... cheers, drl

1 Like

It looks like I'll first run an in-line perform comparing my literal to every place it could be using reference modification. Once I know where it is I can calculate the length of the various parts and STRING them together, throwing in a literal "H".
Thanks for looking at it.