ADS Error Handling

Errors encountered while accessing the database, or involving queue or scratch activity are handled differently depending on whether or not SQL commands are used.
idmscu
Errors encountered while accessing the database, or involving queue or scratch activity are handled differently depending on whether or not SQL commands are used.
SQL Commands
When CA IDMS/DB executes an SQL statement, it returns information about the status of statement execution to a data structure called the SQLCA. The dialog contains logical to handle exceptional conditions resulting from statement execution. This logic takes the form of checking SQLCA information through the use of a conditional statement or through the use of the WHENEVER SQLERROR or WHENEVER SQLWARNING statement. In either situation, control is always returned to the dialog.
For more information about conditional statements and the WHENEVER SQLERROR statement processed during an SQL session, see the
CA IDMS SQL Programming section
.
Non-SQL Commands
When CA IDMS/DB executes a non-SQL process command that involves database, queue, or scratch activity, or a WRITE PRINTER utility command, CA ADS returns a 4-byte status code to an internal error-status field for the issuing dialog. A subsequent process command statement can test for the presence of a specified status code. Based on the outcome of the test, further processing can be done.
Handling errors in the non-SQL environment involves the use of the following:
  • The
    autostatus facility
    , which handles errors generated by command processing
  • Error expressions
    , which specify allowable status codes that can be returned
  • The
    status definition record
    , which allows level-88 condition names to be associated with status codes
The autostatus facility, error expressions, and the status definition record are discussed separately in this section.
Note:
For more information about using automatic editing and error-handling facilities to evaluate input data, see the
CA IDMS Mapping Facility section
.