Requirements for programs that use CAF
The call attachment facility (CAF) enables programs to communicate with Db2. Before you invoke CAF in your program, ensure that your program satisfies any requirements for using CAF.
When you write programs that use CAF, ensure that they meet the
following requirements:
- The program accounts for the size of the CAF code. The CAF code requires about 16 KB of virtual storage per address space and an additional 10 KB for each TCB that uses CAF.
- If your local environment intercepts and replaces the z/OS® LOAD SVC that CAF uses, you must ensure that your version of LOAD manages the load list element (LLE) and contents directory entry (CDE) chains like the standard z/OS LOAD macro. CAF uses z/OS SVC LOAD to load two modules as part of the initialization after your first service request. Both modules are loaded into fetch-protected storage that has the job-step protection key.
- If you use CAF from IMS batch, you must write data to only one system in any one unit of work. If you write to both systems within the same unit, a system failure can leave the two databases inconsistent with no possibility of automatic recovery. To end a unit of work in Db2, execute the SQL COMMIT statement. To end a unit of work in IMS, issue the SYNCPOINT command.
You can prepare application programs to run in CAF similar to how you prepare applications to run in other environments, such as CICS®, IMS, and TSO. You can prepare a CAF application either in the batch environment or by using the Db2 program preparation process. You can use the program preparation system either through DB2I or through the DSNH CLIST.