Determining the real value of Negative SQLCA codes
Currently Mainframe Express (MFE) does not contain documentation about the negative SQLCA code
For example XDB error -2088 or cannot access Mainframe DB2 table via COBOL.
Refer to Appendix D from XDB COBOL Precompiler Manual (See below).
Table D-1 Translating SQLCODE and SQLERRD into XDB Error
For example XBD error code -2088:
SQL DB2 Mode:
Range -1651 to -3000
How to Terminate to XDB Error:
Take absolute value, subtract 1650, prefix with "N"
-2088 minus 1650 give N438
MFE > Help > SQL for DB2 > Error Messages > Network Errors:
N438 shows Security not valid.
The partner LU rejected the UserID or password used in the allocate call.
Turn on security at the client using the Configuration utility.
Make sure the UserID and password are valid for the host environment.
Appendix D from XDB COBOL Precompiler Manual.
Table D-1 Translating SQLCODE and SQLERRD into XDB Error
SQLCA CODES | Range | How to Translate to XDB Error | |
SQLCODE | |||
DB2 Mode | -1 to -999 | Take absolute value and prefix with "L". | |
-1001 to -1650 | Take absolute value, subtract 1000, prefix with "X". | ||
-1651 to -3000 | Take absolute value, subtract 1650, prefix with "N". | ||
-3001 to -29,999 | Not used | ||
-30,000 to -30,100 | Take absolute value and prefix with "L". | ||
XDB Mode Link errors might overlap engine or network errors in this mode. If SQLCODE does not equal SQLERRD then use SQLERRD (described below) | -1 to -650 | Take absolute value and prefix with "X". | |
-651 to -2000 | Take absolute value, subtract 650, prefix with "N". | ||
-2001 to -29,999 | Not used | ||
-3000 to -30,100 | Take absolute value and prefix with "L". | ||
SQLERRD(1) | |||
XDB and DB2 Modes | -1 to -650 | Take absolute value and prefix with "X". | |
-651 to -2000 | Take absolute value, subtract 650, prefix with "N". | ||
-2001 to -3000 | Not used. | ||
-3001 to -3999 | Take absolute value, subtract 3000, prefix with "L". | ||
-4000 to -4100 | Take absolute value, subtract 26,000, prefix with "L". | ||
Examples | |||
COBOL program DB2 mode SQLCODE=-1667 SQLERRD(1)=-667 | 1) SQLCODE IS -1667 2) Absolute value of SQLCODE is 1667 3) 1667 minus 1650 is 17 4) Prefix with "N": N17 - local session table is full | ||
Reference: Knowledge Base Document # 17593