Attachments

Team-Fly    

 
DB2 Universal Database for OS/390 v7.1 Application Certification Guide
By Susan Lawson
Table of Contents
Chapter 14.  Attachment Programming

Attachments

There are five different attachment facilities that can be used depending on the environment where the program will execute. Only one attachment can be active within a program at any given time. The attachments are

  • TSO

  • CICS

  • IMS

  • CAF

  • RRSAF

Each program runs in an address space called the allied address space. The DB2 attachment facility modules are called by the program, execute within the allied address space, and establish communication with the DB2 address spaces. When initialized the attachment modules make the link to DB2 and agent control blocks are created in the DSNMSTR address space to control the program's DB2 processing.

When a program issues a SQL statement, the attachment modules are given control. The attachment programs prepare the request for DB2 and pass it over to the DB2 address space. Results are passed back to the attachment programs and any results are copied into the application storage areas.

Execution Environments

There are several environments in which an application program can execute. The attachment that can be used by a particular program depends on the environment that the program runs in. Table 14-1 shows the attachment facilities that are available for each multiple virtual system (MVS) environment.

Table 14-1. Attachment Facilities for MVS Environments

Environment

TSO

CICS

IMS

CAF

RRSAF

TSO

Y

   

Y

Y

CICS

 

Y

     

IMS

   

Y

Y

 

DL/I Batch

   

Y

Y

 

UNIX System Services

       

Y

Batch

     

Y

Y

Started Task

     

Y

Y

Stored Procedure

     

Y

Y

As you can see, some environments, like TSO, allow for a variety of available attachments, where CICS supports only a single attachment. Knowing where your program will execute is important in organizing a project that consists of several modules, as only one type of attachment can be active at a time.

Program Preparation

Programs using embedded SQL must be precompiled to translate the EXEC SQL statements into code that the language compilers understand. When a program is processed , the precompiler replaces SQL statements with appropriate conditioning source code and a call to the DB2 high-level interface modules, usually DSNHLI or DSNHLI2. Each attachment has a load module that supplies these entry points. This load module must be linked into the application's load module or loaded dynamically at execution time by the application. The attachment interface load modules are listed in Table 14-2.

Table 14-2. Attachment Interface Load Modules

Attachment

Module

TSO

DSNELI

CICS

DSNCLI

IMS

DFSLI000

CAF

DSNALI

RRSAF

DSNRLI

Fortran uses module DSNHFT instead of DSNELI for the TSO attachment. The CICS interface module, DSNCLI, is supplied in the CICS product libraries.

Security

DB2 and RACF provide the capability to control which attachments are available to a given user. The RACF DSNR resource class protects the attachments. When a program attaches to DB2 and transfers control to the DB2 address space, DB2 checks with RACF to verify that the user executing the program is authorized to use the attachment type.

For some attachments, the programmer can control access to a program's package or plan by specifying the ENABLE or DISABLE options on the BIND command. With some of the ENABLE or DISABLE options, a specific connection name can also be listed.


Team-Fly    
Top


DB2 Universal Database for OS. 390 v7. 1 Application Certification Guide
DB2(R) Universal Database for OS/390 V7.1 Application Certification Guide (IBM DB2 Certification Guide Series)
ISBN: 0131007718
EAN: 2147483647
Year: 2002
Pages: 163
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net