The maximum value for Version attribute of CA Datadictionary entities is 999. This limit affects also Ideal entities like programs, panels and reports.
When trying to duplicate a version 999 of an Ideal program to the next version (DUP PGM pgmname V 999 TO NEXT VERSION), a COP004 DSF Return Code is issued:
IDADERRP71E - INTERR: CA-DATADICTIONARY error, RC=COP004
DSF RC COP004 has the following meaning:
CANNOT READ LOCATED VERSION
You encountered an internal error.
Collect all documentation and contact CA Support.
Ideal on z/OS or z/VSE
First of all, the version 999 of the program must be exported via Source Transport Utility (IDUTSTRN) and then imported back as version 001.
For details about this utility, please see "Source Transport Utility--Transport Applications in Source Form" section of CA Ideal documentation.
Then all the History versions (usually 997, 998 and 999) of the involved program must be deleted but it's a good practice (and strongly suggested) to export all these HIST versions (via IDUTSTRN) and archive them as a precaution BEFORE deleting.
Another way to resolve the problem is exporting (via IDUTSTRN) versions 997 (HIST), 998 (HIST) and 999 (PROD), then re-importing them as versions 001, 002 and 003 respectively.
Next mark versions 001 and 002 to HIST again, and 003 to PROD. In this way there are still two levels available on-line to fall back quickly with a DUP command, as opposed to doing the re-import from archive.