To debug connection errors, set the ODBC Operator script "tracelevel" to "special" in the ODBC job script, as follows:
VARCHAR TraceLevel = 'Special'
The following are common connection errors:
- When the DSNACLI plan is not bound at DB2 installation time, the following error occurs:
Fatal error received from ODBC driver: STATE=58004, CODE=-99999, MSG='{DB2 for OS/390}{ODBC Driver} SQLSTATE=58004 ERRLOC CAF "OPEN" failed using DB2 system:DSN9 and PLAN:DSNACLI RC=0c and REASON=00f30040
After maintenance is applied to DB2, a connection failure of (-803) indicates that the plan needs to be rebound. - When you have not obtained DB2 and RACF (ACF2) authorization, the following error occurs:
Fatal error received from ODBC driver: STATE=42505, CODE=-922, MSG='{DB2 for OS/390}{ODBC Driver} DSNT408I SQLCODE = -922, ERROR: AUTHORIZATION FAILURE: 00D31024 ERROR. CONNECT DSNT418I SQLSTATE = 42505 SQLSTATE RETURN CODE
- If ODBC does not connect, the following error occurs:
Fatal error received from ODBC driver: STATE=58004, CODE=-99999, MSG='{DB2 FOR OS/390}{ODBC DRIVER} SQLSTATE=58004 ERRLOC=2:170:9 CAF "CONNECT" failed using DB2 system:DSN9 RC=08 and REASON=00f30002
This can occur for two reasons:
- The Data Source Name is incorrect or does not exist.
- The database system is not running.