TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

Interaction with DB2


An environment is connected to a DB2 subsystem by an attachment facility. Whenever there is a need of interaction with DB2, a thread will be established

A thread is a control structure used to:

  1. Send requests to DB2

  2. Send data from DB2 to the requestor

  3. Communicate the status of each SQL statement after it is executed

image missing
Accessing DB2 from TSO:

You use TSO (Time-Sharing Option) environment as a door that provides access to DB2 data.

The TSO Attachment Facility provides access to DB2 resources in two ways:

  1. Online mode, in the TSO foreground, using ISPF (Interactive System Productivity Facility) panels.

  2. Batch mode using the TSO Terminal Monitor Program - IKJEFT01 (or IKJEFT1B)


DB2I - DB2 Interactive

DB2I (DB2 Interactive) is a TSO-based DB2 application. It consists of a series of ISPF panels, programs, and CLISTs enabling rapid access to DB2 services and data. DB2I increases the TSO DB2 developer's productivity.

How to access DB2I:
  1. Log on to TSO as you normally would. The ISPF main menu appears.

  2. Choose Option 8 (DB2 - Perform DATABASE 2 Interactive Functions) in Cognizant Mainframe.

  3. DB2I Main menu appears as shown in the following screenshot.

image missing

Following Options are available with DB2I:

  1. SPUFI: SQL Processor Using File Input.

  2. DCLGEN: Declaration Generator.

  3. PROGRAM PREPARATION: Prepares a program containing embedded SQL for execution.

  4. PRECOMPILE: Program containing embedded SQL is parsed to retrieve all SQL and replace it with calls to a runtime interface to DB2.

  5. BIND/REBIND/FREE: Provides the capability to bind a DB2 plan & package, rebounda plan & package, remove plan & package from the system.

  6. RUN: enables to run a DB2 application program.

  7. DB2 COMMANDS: Enables to submit DB2 commands using TSO.

  8. UTILITIES: Provides panels that ease the administrative burdens of DB2 utility processing.

  9. DB2I DEFAULTS:Lets you modify parameters that control the operation of DB2I. Be sure that the proper DB2 subsystem is specified in the “DB2 Name” parameter. Be sure that the proper language to be used for preparing DB2 programs in the “Application Language” parameter. A valid job card needs to be supplied in the “DB2I Job Statement” parameter.

  10. EXIT: Leaves DB2I



If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal