Peter,
  The following PROBABLY will not be "acceptable" to you but might still be
worth "approaching" the owner of the original copy member with.  

Consider that "today" there is a copy member called ABC - which includes:

  01 Group1.
     05  WS-AlphaNum  Pic X.
     05  WS-Num       Pic 9.

Now, you want to be able to "replace" "WS-" but the owner of ABC doesn't
want to have to change their programs that COPY it in.  The "solution"
(work-around) is to create a NEW member called ABC (in other words this
replaces the existing member ABC).  It includes the following code.

  Replace  ==:tag:== by ==WS-==.
     Copy ABCx.
  Replace Off.

Then you create a NEW member called ABCx which includes the following:
  01 Group1.
     05  :TAG:AlphaNum  Pic X.
     05  :TAG:Num       Pic 9.

The every program that has 
   COPY ABC.
will continue to work exactly as it does today - even if it uses nested COPY
statement.  

However NEW program (that want to change prefixes) can use

  Copy ABCX
    replacing ==:TAG:== BY ==New-Prefix-==.

***

Furthermore, the current OWNER of member ABC will continue to "own" (and
maintain) it as well as member ABCX.

   ****

I haven't stressed this enough in previous posts, but it is important to
realize that the COBOL standard defines COPY REPLACING and REPLACE as "text
word" replacement tools and never CLAIMS to be "string" replacement tools.
This is certainly a (nearly?) unique feature of COBOL, but it is what the
feature is designed to do - and does.

"Farley, Peter x23353" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> > -----Original Message-----
> > From: Bill Klein [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, November 08, 2007 11:15 PM
> > To: [email protected]
> > Subject: COBOL COPY statement w REPLACING...
> > 
> > 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
> 
> Yes, I am well aware of that method.  It requires changing the contents of
> the copybook.  If I may quote my original situation:
> 
> "... where an older copybook did not have separators around the leading
> prefix, so it could not be replaced."
> 
> IOW, this copybook does NOT have "tagged" prefix "words" for each
variable,
> just normal COBOL words.  The copybook can be used WITHOUT any REPLACING
> strings.
> 
> I want to be able to use REPLACING for such a copybook WITHOUT modifying
the
> copybook (because I don't own it and am not allowed to change it).
> 
> Why can't we do such a simple thing?
> 
> Peter

----------------------------------------------------------------------
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

Reply via email to