Technote (troubleshooting)
Problem(Abstract)
The following statement
COPY MYCOPY REPLACING ==:Y:== BY ==AAA==
REPLACING ==:Z:== BY ==BBB==.
produced this error message:
IGYLI0088-S The "COPY" statement was invalid. Expected "BY", but found "==". The statement was discarded.
Cause
The REPLACING keyword may only be used once.
There may be multiple operand pairs.
Resolving the problem
The diagram of the COPY statement in the COBOL Language Reference shows
_ Format ____________________________________________________________
| >>__COPY__ _text-name_ __ ______________________________________> |
| |_literal-1_| |_ _OF_ __ _library-name_ _| |
| |_IN_| |_literal-2____| |
| |
| >__ __________ __ _______________________________________ __.__>< |
| |_SUPPRESS_| | <_____________<____________ | |
| |_REPLACING__|_operand-1__BY__operand-2_|_| |
|___________________________________________________________________|
The syntax word REPLACING may only be used once; the second use is not interpreted correctly. When the statement is recoded with the second REPLACING removed, ie:
COPY MYCOPY REPLACING ==:Y:== BY ==AAA==
==:Z:== BY ==BBB==.
the statement compiles correctly and both code string replacements are done.
| Segment | Product | Component | Platform | Version | Edition |
|---|---|---|---|---|---|
| Software Development | COBOL for OS/390 & VM | OS/390, VM/ESA, VSE/ESA, z/OS | 2.1, 2.2, 1.1.1, 2.1.2, 2.1.1 |
Rate this page:
Average rating
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.