The documented (and functional) way to do partial replacement in current
COBOL is documented at:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr31/8.1.7.3
Int the part starting,
"The COPY statement with REPLACING phrase can be used to replace parts of
words."
However, a better "example" is later at the page in the section labeled
Example 3
NOTE WELL:
If/when you use this, the COPY member may NOT be used without the
REPLACING option, so you can only use this technique for structures that are
ALWAYS replaced.
***
As I said in my original note, for those wanting to "combine" COPY
processing and REPLACING processing - with nested COPY's, the thing to do is
to use the
REPLACE statement
which can be coded in either the "main" source (before the COPY statement -
or within any nested COPY member. You should use the REPLACE OFF variation
AFTER the "main" COPY statement to turn it off.
***
P.S. BOTH the ":TAG:" approach to partial word replacement and using
REPLACE with nested COPY's are portable to any Standard conforming COBOL
compiler.
"Farley, Peter x23353" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> > -----Original Message-----
> > From: Bill Klein [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, November 07, 2007 10:25 PM
> > To: [email protected]
> > Subject: Fw: COBOL COPY statement w REPLACING...
> >
> > I assume (but could be mistaken) that you are trying to replace a "part
of
> > a string" rather than a COBOL "text word". Besides the fact that there
are
> > "work-arounds" for doing partial word replacement, you might be
interested
> > that the current ('02) standard DOES allow for replacing a "leading" or
> > "trailing" part of a COBOL text word (but not the middle). If you want
> > this feature sooner than later (in IBM COBOL) you may want to submit a
> > marketing REQUEST to IBM referencing the existing SHARE requirement for
> > this facility.
>
> Bill, would you please enlarge upon the "work-arounds" for partial word
> replacement or point to a url where it is described? I recently ran into
> this myself, where an older copybook did not have separators around the
> leading prefix, so it could not be replaced.
>
> If there is a way to do this in current IBM COBOL technology (Enterprise
> 3.3) *without* updating the copybook, I'd sure like to know what it is.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html