Fw: COBOL COPY statement w REPLACING...



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" <Peter.Farley@xxxxxxxxxxxxxx> wrote in message
news:<A217F9A4D7684B4DB03E3F76269FDEE21863548F@xxxxxxxxxxxxxxxxxxxxxxxx>...
-----Original Message-----
From: Bill Klein [mailto:wmklein@xxxxxxxxxxxxx]
Sent: Thursday, November 08, 2007 11:15 PM
To: IBM-MAIN@xxxxxxxxxxx
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 listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
.



Relevant Pages

  • Re: about IEWL parameters or so
    ... Then don't specify LET. ... replacement of a member in load library after an unsuccessful link-edit? ... You specified a parameter to cause it to replace a member that it ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Re: about IEWL parameters or so
    ... IFRC LET allows the RC=8 to replace the member. ... Is there any parameter in order to prevent the replacement of a ... The sender believes that this E-mail and any attachments were free of any ... Search the archives at http://bama.ua.edu/archives/ibm-main.html ...
    (bit.listserv.ibm-main)
  • Re: about IEWL parameters or so
    ... K Zafirop wrote: ... In IEWL link-edit procedures we have specified for parameters ... I think that the member should not be ... replacement of a member in load library after an unsuccessful link-edit? ...
    (bit.listserv.ibm-main)
  • Re: THIS STATEMENT HAS NO PROOF IN ANY SYSTEM = true or false?
    ... Daryl McCullough wrote: ... >What is the hereditary property? ... Any member of a set is a set. ... >equivalent if we assume foundation (and replacement): ...
    (comp.theory)
  • Re: THIS STATEMENT HAS NO PROOF IN ANY SYSTEM = true or false?
    ... Daryl McCullough wrote: ... >What is the hereditary property? ... Any member of a set is a set. ... >equivalent if we assume foundation (and replacement): ...
    (sci.math)