Problem solve Get help with specific problems with your technologies, process and projects.

Suppress the duplicate key message

I tried to suppress the duplicate key message (CPF5009 and CPF5026) while building an extract file - known duplicates, using a COBOL program. Why does the message still appear when the invalid key is handled with a status check?

If you use a READ prior to WRITE and manually control the duplicates, the error message will not appear. If you use the status, you must also use a file status clause, USE procedure or INVALID KEY phrase in order to avoid the message from appearing. The error message will still appear in the joblog, but not as an exception message to the user. You can find more information in the COBOL reference here.


The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Dig Deeper on RPG iSeries programming