CAF connection functions
A CAF connection function specifies the action that you want CAF to take. You specify these functions when you invoke CAF through CALL DSNALI statements.
You can specify the following CAF functions in a CALL DSNALI statement:
- CONNECT
- Establishes the task (TCB) as a user of the named DB2® subsystem. When the first task within an address space issues a connection request, the address space is also initialized as a user of DB2.
- OPEN
- Allocates a DB2 plan. You must allocate a plan before DB2 can process SQL statements. If you did not request the CONNECT function, the OPEN function implicitly establishes the task, and optionally the address space, as a user of DB2.
- CLOSE
- Commits or abnormally terminates any database changes and deallocates the plan. If the OPEN function implicitly requests the CONNECT function, the CLOSE function removes the task, and possibly the address space, as a user of DB2.
- DISCONNECT
- Removes the task as a user of DB2 and, if this task is the last or only task in the address space with a DB2 connection, terminates the address space connection to DB2.
- TRANSLATE
- Returns an SQL code and printable text that describe a DB2 hexadecimal error reason code.
This information is returned to the SQLCA. Restriction: You cannot call the TRANSLATE function from the Fortran language.
Recommendation: Because
the effect of any CAF function depends on what functions the program
has already run, carefully plan the calls that your program makes
to these CAF connection functions. Read about the summary of CAF behavior
and make these function calls accordingly.