Troubleshooting
Problem
This document discusses the return codes that might be returned by iSeries Access for Windows APIs.
Resolving The Problem
IBM Documentation lists the return codes by name and numeric constant. The return codes are divided into a global list and a IBM i Access for Windows-specific list. Both lists can be found at the following URL: https://www.ibm.com/docs/en/i/7.4?topic=codes-specific-return Or by navigating to IBM Documentation at https://www.ibm.com/docs/en/i/7.4 then, expanding the following options in the content navigation bar on the left side of the page.
- Connecting to your system
- IBM i Access
- IBM i Access Client Solutions: Application Packages
- Windows Application Package
- Programming
- C/C++ APIs
- C/C++ APIs overview
- Return codes and error messages
- Return codes
- Specific return codes
The IBM i Access Client Solutions - Windows Application Package: Programming manual lists return codes by constant name (CWB_OK or CWB_LICENSE_ERROR for example), not the numeric value of the return code. The manual does not list all possible return codes for each API but lists only the most common return codes. The complete list of IBM i Access Client Solutions Windows API return codes is defined in the CWB header files. To map a numeric return code to a particular constant name, you must use the CWB header files that are contained in the Client Access and iSeries Access for Windows toolkit. The toolkit is installed with IBM i Access Client Solutions Windows Application Package.
After you install the toolkit, locate the header files in the ..\client access\toolkit\include directory. Return codes fall into the following categories:
- Global return codes corresponding to operating system errors
- Global return codes unique to Access Client Solutions Windows Application Package
- Specific return codes for each Access Client Solutions Windows Application Package API set
Global return codes are defined in the file CWB.H.
Return codes that are specific to an API group are defined in the header files for that particular group. The constant is defined as offset relative to a start point for that API family. To map this error to a numeric value, you must determine the offset, then the start point. The start points are defined relative to another constant, which is defined in CWB.H.
The following is an example of how to find the constant for a data queue API return code of 6014:
Return codes that are specific to an API group are defined in the header files for that particular group. The constant is defined as offset relative to a start point for that API family. To map this error to a numeric value, you must determine the offset, then the start point. The start points are defined relative to another constant, which is defined in CWB.H.
The following is an example of how to find the constant for a data queue API return code of 6014:
- Locate CWBDQ.H in the toolkit\include directory.
- Search for the definition of CWBDQ_START (usually near the top of the file):
#define CWBDQ_START CWB_LAST + 1 - Track down CWB_LAST in the CWB.H file:
#define CWB_LAST = 5999 - Back to CWBDQ.H, search for offset 14:
#define CWBDQ_INVALID_TIME CWBDQ_START + 14
A list of the most popular return codes follows. The following list was derived from the R312 Client Access header files and might not be complete. The header files contain the most current and accurate information.
Client Access Return Codes Corresponding to Operating System Errors |
Client Access Service Return Codes |
Client Access Database Return Codes |
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"},{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSRQKY","label":"IBM i Access Client Solutions"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]
Historical Number
8090507
Was this topic helpful?
Document Information
Modified date:
01 July 2021
UID
nas8N1010205