The FairCom DB error codes are listed in the Error Code Reference.
There are two classes of FairCom DB errors: user errors and internal fatal errors. User errors arise because of application program errors (e.g., forgetting to open a file before using it), an unsuccessful operation (e.g., attempting to add a duplicate key value to an index not set up for duplicates), or the unavailability of system resources (e.g., no more disk space available). Internal fatal errors arise when FairCom DB data structures are clobbered, (i.e., memory is overwritten), or when data and/or index files are unexpectedly corrupted.
When a user error occurs, a global error code variable is set to an appropriate non-zero value usually referred to as the error code. For low-level file functions, the error code variable is uerr_cod. For ISAM functions, the error code variable is isam_err. In addition, isam_fil is set to the file number of the data or index file involved. Some of the FairCom DB low-level functions also set a global error variable sysiocod to the value of errno when a C runtime function experiences an I/O error. errno is the Language C run-time error variable which is automatically maintained by the C run-time library. Unlike uerr_cod, sysiocod is not reset by new calls to FairCom DB. It is only set to errno if an open, create, seek, read, write, or lock function fails.
A zero value for uerr_cod or isam_err is always associated with a successful file operation.
In addition to setting an error code variable, all of the ISAM functions, and many of the low-level file functions, return the error code value themselves.