Colleagues,
Our standards committee is reviewing error handling for new CICS COBOL programs that call DB2. Legacy modules use HANDLE CONDITION ERROR to branch to a common error section. Newer guidance in our internal wiki favors checking EIBRESP and SQLCODE explicitly after each command.
Representative legacy pattern:
cobol
EXEC CICS HANDLE CONDITION
ERROR(ERROR-ROUTINE)
NOTFND(MISSING-RECORD)
END-EXEC.
EXEC CICS READ FILE('CUSTMAST')
INTO(CUSTOMER-RECORD)
RIDFLD(CUST-KEY)
END-EXEC.
The IBM CICS Application Programming Reference notes:
My question: for maintainability, is it reasonable to prohibit new HANDLE CONDITION usage entirely, or are there vetted cases where it remains preferable?The RESP option can be used to obtain a response code without affecting the flow of control through the HANDLE CONDITION mechanism.
Regards,
James