While building a utility to manage the ISAM files in our big app I had
occasion to implement the CDF functions COPY, COPY/REPLACE, and REPLACE.
These functions are still in need of attention. My observations:
COPY <file>
COPY <file> REPLACE ==field1== BY ==field2==.
COPY <file> REPLACE LEADING ==field1== BY ==field2==.
COPY <file> REPLACE ==field1== BY ==field2==
END-COPY.
REPLACE <file> REPLACE ==field1== BY ==field2==.
REPLACE <file> REPLACE LEADING ==field1== BY ==field2==.
REPLACE <file> REPLACE LEADING ==field1== BY ==field2==,
REPLACE LEADING ==field3== BY ==field4==.
The program wherein I use these CDF statements has about 20 files defined
as source file definitions and the same number of target files. The
target file definitions used the same copybook as the source but with a
REPLACE CDF ie:
REPLACE <file> REPLACE LEADING ==field1== BY ==field2==.
COPY <copybook>.
REPLACE OFF.</copybook></file>
This always modified the code correctly for the compiler. However the
modified code was not always reflected in the listings. The listings may
reflect the modified code correctly through a couple of REPLACE functions
and then the next REPLACE did not. Strangely the next REPLACE might show
in the listing correctly.
There has some commentary about these issues in the discussion blog but
the best I can tell these issues are still at large. I reviewed the
change log but did not see where any code may have been applied. Since
I have a solution this is just a FYI.
I enclose a short program and a copybook for it. Several of the CDF
combinations are used with additional notes in the source code. If one
desires some code can be edited out and then run through 'cobc' to note
any issues. The program as is does not compile.
enc: test-replace.cbl test-replace-area.cpy
cobc -v:
cobc (GnuCOBOL) 3.2-dev.0
Built Feb 28 2023 14:36:32 Packaged Feb 28 2023 20:33:33 UTC
C version "9.4.0"
r5080
Diff:
There is no bug here:
I think this bug can be closed as not a bug.