I was preparing for an interview, and I was thinking what I would say if asked about CAF... I don't know much about the Call Attachment FAcility, so can't claim to know it in detail, just the basics
But here is what I was able to find out thru google, and checking out a few modules on a system someone else is working on (The system I work on has IMS):
1. With CAF, you can execute your Cobol-DB2 module through
you have to give the Subsystem and Plan name in DSNPARM DDNAME ( I guess this could be shop specific, not sure)Also needed is the DSNLOAD library that should be included in the STEPLIB
2. CAF is an alternative to using the IKJEFT1B TSO monitor utility.
3. It uses DSNALI to control the connection to DB2, this is the CAF language interface. Five calls are used :
CONNECT :Establishes a connection between the program's MVS address space and DB2
DISCONNECT : Eliminates the connection between the MVS address space and DB2
OPEN : Establishes a thread for the program to communicate with DB2
CLOSE :Terminates the thread
Provides the program with DB2 error message information, placing it in the SQLCA
One benefit of using CAF is that it provides explicit control of thread creation. In addition, CAF is more efficient than DSN because of the elimination of overhead required by the TSO TMP, IKJEFT01 (or IKJEFT1B). Another benefit is that a program designed to use CAF can run when DB2 is down. It cannot access DB2 resources, but it can perform other tasks. This capability can be useful when the DB2 processing is optional, parameter driven, or contingent on other parts of the program.
CAF has its drawbacks too, though. For example, CAF requires more complex error handling procedures. DSN automatically formats error messages for connection failures, but CAF returns only a return code and a reason code. Another drawback is that DSN handles the connection automatically, but CAF requires the program to handle the connection. These drawbacks can be eliminated, however, if you modify the CAF interface module used at your site. Note that by modifying the CAF module your shop must support logic that otherwise is provided with DB2 (and supported by IBM).
However the Cobol module I checked did not contain these keywords, I guess these must be inserted during the pre compile phase ?
5. CAF programs must be link-edited with the CAF language interface module, DSNALI.
I guess that should be enough to satisfy the interviewer, since I never claimed I am a DB2 resource in any case and have very little(minimal ) experience in DB2 ....
My observations regarding the info above are in bold. Have I missed something obvious or made a huge blooper? I also need some more info on where exactly using CAF would be benefecial as compared to IKJEFT1B for execution.
Just curious about the following:
The modules I saw just accessed a table and accessed the data like any other DB2 module and on a glance, I felt these could have been executed using IKJEFT1B as well (I must say I just looked at Batch modules, not CICS). Would using CAF provide a significant improvement in efficiency for either batch or CICS? Is the overhead from the terminal monitor the only consideration? And is this post too long?