Summary of CAF behavior

The effect of any CAF function depends in part on what functions the program has already run. You should plan the CAF function calls that your program makes to avoid any errors and major structural problems in your application.

The following table summarizes CAF behavior after various inputs from application programs. The top row lists the possible CAF functions that programs can call. The first column lists the task's most recent history of connection requests. For example, the value CONNECT followed by OPEN in the first column means that the task issued CONNECT and then OPEN with no other CAF calls in between. The intersection of a row and column shows the effect of the next call if it follows the corresponding connection history. For example, if the call is OPEN and the connection history is CONNECT, the effect is OPEN; the OPEN function is performed. If the call is SQL and the connection history is empty (meaning that the SQL call is the first CAF function the program), the effect is that implicit CONNECT and OPEN functions are performed, followed by the SQL function.

Table 1. Effects of CAF calls, as dependent on connection history
Previous function Next function
CONNECT OPEN SQL CLOSE DISCONNECT TRANSLATE
Empty: first call CONNECT OPEN CONNECT, OPEN, followed by the SQL or IFI call Error 2031 Error 2041 Error 2051
CONNECT Error 2011 OPEN OPEN, followed by the SQL or IFI call Error 2031 DISCONNECT TRANSLATE
CONNECT followed by OPEN Error 2011 Error 2021 The SQL or IFI call CLOSE2 DISCONNECT TRANSLATE
CONNECT followed by SQL or IFI call Error 2011 Error 2021 The SQL or IFI call CLOSE2 DISCONNECT TRANSLATE
OPEN Error 2011 Error 2021 The SQL or IFI call CLOSE2 Error 2041 TRANSLATE
SQL or IFI call Error 2011 Error 2021 The SQL or IFI call CLOSE2 Error 2041 TRANSLATE3
Notes:
  1. An error is shown in this table as Error nnn. The corresponding reason code is X'00C10nnn'. The message number is DSNAnnnI or DSNAnnnE.
  2. The task and address space connections remain active. If the CLOSE call fails because Db2 was down, the CAF control blocks are reset, the function produces return code 4 and reason code X'00C10824', and CAF is ready for more connection requests when Db2 is up.
  3. A TRANSLATE request is accepted, but in this case it is redundant. CAF automatically issues a TRANSLATE request when an SQL or IFI request fails.