Handling COBOL Errors
If your COBOL program needs error handling, try the following procedure:
Add a field (return code) to your state record.
Initialize the field to a negative value.
Pass the value into the Application Engine program.
At the successful completion of the Application Engine program, change the field value to a positive value.
Check for that value in your COBOL program.