Call attachment return codes
If the CONNECT or DISCONNECT command fails, the DB2 Call Attachment Facility (CAF) sets other return codes, which are documented in the IBM DB2 Messages and Codes manual.
The CAFREASON variable contains the CAF reason code for CAF failures as follows:
Connect failed, rc = 8, cafreason = 00F30082
You can use the variable SQLSTATE in addition to SQLCODE. SQLSTATE indicates warnings as well as errors as follows:
ASURXSQL return code = 37 near line 137
DSNT408I SQLCODE = -991, ERROR: CALL ATTACH WAS UNABLE TO ESTABLISH AN
IMPLICIT CONNECT OR OPEN TO DB2. RC1=000C RC2=00F30006
DSNT418I SQLSTATE = 57015 SQLSTATE RETURN CODE
DSNT408I SQLCODE = -991, ERROR: CALL ATTACH WAS UNABLE TO ESTABLISH AN
IMPLICIT CONNECT OR OPEN TO DB2. RC1=000C RC2=00F30006
DSNT418I SQLSTATE = 57015 SQLSTATE RETURN CODE
If the product issues a warning without an error, ASURXSQL will return rc=0 SQLCODE=0 so that the row values will be available.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*