176 Data Integrity with DB2 for z/OS
6.1 DB2 attachment facilities
An attachment facility can be thought of as a required portal or gateway when a user request
to connect to a DB2 subsystem originates from certain environments. In order to
communicate with DB2 for z/OS from a Customer Information Control System (CICS),
Information Management System (IMS), Time Sharing Option (TSO), batch or WebSphere
(when using RRS) environment, a DB2 attachment facility is required to establish a session.
Attachment facilities are subcomponents of DB2 that run in the user’s address space.
The CICS attachment facility, language interface module DSNCLI, is provided by the CICS
product. It receives CICS application requests and passes them to DB2. Example 6-1 shows
the standard CICS command-level services that you can use.
Example 6-1 CICS command-level services used with the CICS attachment facility
By issuing DB2 commands, an authorized CICS terminal operator is able to control and
monitor DB2 and the attachment facility.
The IMS attachment facility, program interface DFSLI000, is required to access DB2 from an
IMS environment. It receives and interprets requests for access to DB2 databases using exits
provided by IMS subsystems. The IMS attachment facility also allows an authorized IMS
terminal operator the ability to issue DB2 commands such as starting and stopping DB2
The TSO attachment facility offers unique functionality. It is required for binding application
plans and packages and executing online DB2 functions. In fact, the CICS and IMS
attachment facilities depend on the TSO attachment facility for these functions.
Access to DB2 in the foreground through a TSO terminal or in batch mode through the TSO
terminal monitor program (TMP) can be accomplished with the TSO attachment facility. In
addition, two command processors are provided:
DSN command processor: Primarily used for batch jobs, uses the TSO attachment facility
and runs as a TSO command processor
DB2 Interactive (DB2I): An interactive connection to DB2 allowing users to run SQL
statements, issue DB2 commands, and run DB2 utilities using Interactive System
Productivity Facility (ISPF) panels
With the TSO attachment facility, load module DSNELI, access to DB2 is fairly simple. On the
other hand, this also means that an application has less control over the status of the
connections and, when using DSN services, applications running under the control of DSN.
Call attachment facility (CAF)
As the alternative attachment facility for TSO and batch applications, CAF supplies additional
connection functionality and greater control over the execution environment including:
Explicit control over the status of the connection to DB2.
Used with or without TSO TMP.

Get Data Integrity with DB2 for z/OS now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.