Return values

This section lists the various return codes.

Using the ERROR code

Successful execution of any command sets the ERROR code to zero and returns control to the application program. If tableBASE encounters an error, the ERROR code field of the xxxx-COMMAND-AREA is set appropriately, and if the abend switch is on, the task or application will abend. The details regarding the abend switch can be found with the description of the Change Status command (see Change Status (CS)). In addition Chapter 4 describes a temporary ABEND override.

ERROR subcode

An error subcode was added with Version 6. The subcode provides additional information and is meant to be used with the ERROR code to help you pin-point a problem (see tableBASE return codes).

Using the FOUND code

The FOUND code indicates whether a search or retrieval was successful. All commands set the FOUND code in xxxx-COMMAND-AREA to either Y or N. Generally, this flag is set to N, except for the commands listed in Table 60 where either setting is valid.

Table 60. Commands that set the FOUND code

Purpose

Command

Retrieval

SK, FK, FC, FG, FN, GF, GL, GN, GP

Updating

DK, IK, RK,

DC (always Yes, if no error),

IC (always No),

RC (always Yes, if no error)

Table Control

GD

Library Maintenance   

NX

Most common programming errors can be avoided by testing the FOUND code when using these commands.

Note:
If you have used date-sensitive processing with earlier releases of tableBASE, you should be aware that those earlier releases allowed a value of X to be placed in the FOUND-CODE when using a Fetch by Key (FK) operation. See Compatibility with previous releases of tableBASE for further details.