IMS

Team-Fly    

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

IMS

IMS programs access DB2 using the IMS attach facility. It is also possible, but not recommended, to use the CAF.

Capabilities

IMS provides a high-performance execution environment for application programs. An IMS region can connect to one or more DB2 subsystems. You can enter DB2 commands through the /SSR command of IMS.

Restrictions

IMS allows you to define as many external subsystem connections as are required. More than one connection can be defined for different DB2 subsystems. All DB2 connections must be within the same MVS system.

Requirements

The DB2 identification must be defined to the control region, the DL/I batch region, and optionally to each dependent region accessing that DB2 system. To make this identification, you must create a subsystem member (SSM) in the IMS.PROCLIB library, and identify the SSM to the applicable IMS regions. One SSM can be shared by all of the IMS regions , or a specific member can be defined for each region. The fields in this record are as follows :

  • SST=DB2 defines the external subsystem type.

  • SSN=ssid must be the DB2 subsystem name .

  • LIT=SYS1 specifies the language interface token supplied to IMS.

  • ESMT=DSNMIN10 specifies the external subsystem module table.

  • RTT= is an optional resource translation table (RTT). This table maps the IMS application names into DB2 plan names . If omitted, the load module name is used as the plan name. DB2 provides the DSNMAPN macro to generate an RTT.

  • REO= is the region error option to be used. A value of R, the default, causes an appropriate SQL return code to be passed back to the application, except on the first connection when the application is abended. A value of Q abends the application.

  • CRC= is the command recognition character (CRC) used by IMS to identify DB2 commands entered from an IMS terminal.

  • CONNECTION_NAME= specifies the name of the job step that is the coordinator for DB2 activity for DL/I batch. DB2 requires unique connection names for DB2 DL/I batch support. If two applications try to connect with the same connection name, then the second application is not allowed to connect to DB2.

  • PLAN= specifies the DB2 plan name for DL/I batch.

  • PROG= specifies the application program to loaded and execute.

Execution

Programs using the IMS attachment facility run under the control of IMS or as DL/I batch applications.

Units of Work

Like CICS, IMS manages synchronization points and coordinates committing or backing out the UOW with DB2. The SQL COMMIT and ROLLBACK statements are not allowed in IMS programs. Instead, the appropriate IMS facilities should be used to issue checkpoints, commit work, or roll back work. DB2 automatically backs out changes when an application program abends. DL/I changes may need to be backed out using the DL/I batch backout utility.

Program Characteristics

There are some specific characteristics for programs running under the IMS attachment facility.

Initialization

Programs using the IMS attachment require no special initialization processing. Even though a region can communicate with two or more DB2 subsystems, an IMS application can access only the DB2 subsystem referred to in the language interface that is link-edited. You can alter the SSM to route application requests to a different DB2 subsystem.

Programs do not need to code CONNECT statements, since the DB2 subsystem specification is controlled by the SSM. They can issue CONNECT statements to connect to remote databases defined in the local communications database.

SQL Processing

Programs use embedded SQL statements. The DB2 precompiler translates the statements into the appropriate language calls to the high-level interface module during compilation.

Error Checking

As with the TSO and CICS attachments, programs should check the SQLCODE or SQLSTATE returned in the SQLCA after every SQL statement to determine its status.

Termination

Normal termination for IMS/DB2 programs consists of closing cursors , if any, and following standard termination procedures for IMS programs. If an IMS program abends, IMS controls the termination and backout processing.


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