Error code parameter

An API error code parameter is a variable-length structure that is common to most of the system APIs. The error code parameter controls how errors are returned to the program.

The error code parameter must be initialized before the program calls the API. Depending on how the error code structure is set, this parameter either returns information associated with an error condition or causes errors to be returned as exception messages.

For some APIs, the error code parameter is optional. If you do not code the optional error code parameter, the API returns diagnostic and escape messages. If you code the optional error code parameter, the API can either signal exceptions or return the exception information in the error code parameter.

Notes:
  • The ILE CEE APIs use feedback codes and conditions.
  • The UNIX-type APIs use errnos to report error conditions.

The error code structure is provided in the QSYSINC library and is called QUSEC.