overview of cics and db2 interface

14
Jan 20, 2022 Overview of CICS and DB2 Interface I.T.TRAININGS 1 Overview of CICS and DB2 Interface Course designed and Conducted by Sunderrajan Iyer [email protected]

Upload: venu

Post on 17-Nov-2014

721 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

1

Overview of CICS and DB2

Interface

Course designed and Conducted

by

Sunderrajan Iyer

[email protected]

Page 2: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

2

CICS attachment facility

• A CICS attachment facility is provided with CICS that allows you to operate DB2 with CICS. – The connection between CICS and DB2 can be created or

terminated at any time, and CICS and DB2 can be started and stopped independently.

– You also have the option of CICS automatically connecting and reconnecting to DB2.

– The DB2 system can be shared by several CICS systems• But each CICS system can be connected to only one DB2

subsystem at any one time.

Page 3: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

3

Attachment Commands

• Attachment commands display and control the status of the attachment facility and are issued using the supplied CICS transaction DSNCDSNC.

• The attachment commands are: – STRT - start the connection to DB2 – STOP - stop the connection to DB2 – DISP - display the status of the connection to DB2 – MODI - modify characteristics of the connection to DB2 – DISC - disconnect threads

Page 4: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

4

More on Attachment Facility

• The CICS DB2 attachment facility provides a multithread connection to DB2– There is a thread for each active CICS transaction

accessing DB2 – Threads allow each CICS application transaction and DB2

command to access DB2 resources• Application Plan

– Each thread, used by a CICS transaction, or by a command, runs under its own subtask task control block (TCB).

– A thread is defined based on the specifications in RDO when a transaction issues the first SQL statement

– If a existing thread is available, it is used before creating a new thread

Page 5: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

5

Types of Threads

• Command Threads– These are reserved to be used by the DSNC transaction

• Entry Threads– They are intended to be used by transactions

• If defined as protected, they are not terminated when no CICS transaction is using them

• If defined as unprotected, they are terminated if no CICS transaction is using them

• Pool Threads– They are used for all transactions not using Entry or

Command thread– They are intended for low volume transactions, and as a

overflow from command and entry threads

Page 6: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

6

How CICS interacts with DB2

• The CICS DB2 attachment facility provides CICS applications to access DB2 database while operating in the CICS environment– The application can access both CICS and DB2 data at the

same time

• CICS co-ordinates recovery of both DB2 and CICS data when a failure occurs

Page 7: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

7

How CICS interacts with DB2

Page 8: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

8

Address Spaces in DB2

• DSN1MSTR: System Service Component• DSN1DBM1: Database Service Component• DSN1DIST : Distributed Service Component• IRLMPROC : Resource Lock Manager• DSN1SPAC: For DB2 stored procedures

Page 9: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

9

How a CICS Task works with DB2• When an application program issues its first SQL

request the CICS resource manager interface (RMI) processes the request and passes control to the attachment facility's task related user exit (TRUE).

• A transaction thread is scheduled by the CICS attachment facility, and at this stage DB2 checks authorization, creates control blocks and allocates the application plan.

• When the SQL request completes DB2 passes data back to the CICS attachment facility, and the CICS task regains control until the CICS transaction issues another SQL request.

• Finally, the CICS attachment facility returns control to the CICS application program.

Page 10: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

10

How a CICS Task works with DB2

Page 11: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

11

Resource Control Table

• In releases of CICS prior to Transaction Server for OS/390 V1 R2, the connection between CICS and DB2 was done using resource control table

• The resource control table contains relationship between CICS transactions and the resources it requires– Application Plans

• It is generated using DSNCRCT macro provided by CICS attachment facility

Page 12: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

12

Resource Definition Online

• CICS TS R3, no longer supports RCT entries defined using DSNCRCT macro

• You have to use Resource Definition Online facility of CICS TS R3

• Using RDO following objects can be created– DB2CONN: Defines the global attributes of the CICS DB2

interface and defines the attributes of pool threads and command threads

– DB2ENTRY: Defines entry threads to be used by a specific transaction or group of transactions

– DB2TRAN: Defines additional transactions to be associated with a particular DB2ENTRY

Page 13: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

13

Main activities in SQL processing

• You should select the thread type to use for a given set of transactions together with the BIND parameters for the corresponding plan.

• This is because the BIND parameters determine whether a number of activities are related to the thread or to the transactions.

• The main DB2 activities involved in processing CICS transactions with SQL calls are – Create a thread or reuse an existing thread. – Process the SQL statements. – Perform commit processing. – Terminate the thread or keep it.

Page 14: Overview of CICS and DB2 Interface

Apr 8, 2023 Overview of CICS and DB2 Interface

I.T.TRAIN

INGS

14

Main activities in SQL processing

• These main activities are performed for each transaction.

• The most important options are: – DB2CONN and DB2ENTRY specifications

• Use of protected entry threads

• Use of unprotected entry or pool threads

• Authorization strategy

– BIND options• ACQUIRE

• RELEASE

• VALIDATE

– Use of PACKAGES