An API error code parameter is a variable-length structure that is common to all of the system APIs.
The error code parameter controls how errors are returned to the application. The 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.
The error code structure is provided in the QSYSINC library and is called QUSEC.