How are database errors reported to the COBOL program?
Where errors can be “translated” into a common COBOL error, this is done. For example, if a table was opened for input and it did not exist, a standard error “35” would be returned to the program. Where no suitable COBOL error exists, an error 9D is returned and a secondary error code is set. This secondary code is the code returned by the RDBMS. The programmer may make use of the ACUCOBOL-GT routine “C$RERR” to obtain the secondary code. Back to top • Must the database table match the COBOL FD exactly? All the columns named in the XFD file must exist, and have consistent data types. The behavior for any “extra” columns in the table is database dependent. For Informix and Oracle, extra columns are ignored. For other databases an error is generated, unless the configuration variable 4GL-EXTRA-DB-COLS-OK is set to “1”, in which case no error is produced. Obviously, for consistency, any key that does not allow duplicates should match a unique index in the table, but no other indexes are r