CALL ATTACHMENT FACILITY(CAF): It is an attachment facility which is a part of the DB2 code that allows other programs to connect to and use DB2 to process SQL statements, commands, or instrumentation facility interface (IFI) calls. With the call attachment facility (CAF), your application program can establish and control its own connection to DB2. Programs that run in MVS batch, TSO foreground, and TSO background can use CAF.
The advantages of a program using CAF:
Access DB2 from MVS address spaces where TSO, IMS, or CICS do not exist.
Access DB2 from multiple MVS tasks in an address space.
Access the DB2 IFI.
Run when DB2 is down (though it cannot run SQL when DB2 is down).
Run with or without the TSO terminal monitor program (TMP).
Run without being a subtask of the DSN command processor (or of any DB2 code). etc...
CAF differs from the previous attach mechanisms in that it does not provide teleprocessing services. CAF is used to manage connections between DB2 and batch and online TSO application programs, without the overhead of the TSO terminal monitor program.
CAF programs can be executed as one of the following:
An MVS batch job
A started task
A TSO batch job
An online TSO application
Typically, a control program is created to handle the establishment and termination of the DB2 connection. Although this module is not required, it is recommended so that you can eliminate the repetitious coding of the tedious tasks associated with connecting, disconnecting, opening, and closing.
CAF programs must be link-edited with the CAF language interface module, DSNALI .