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:
Send requests to DB2
Send data from DB2 to the requestor
Communicate the status of each SQL statement after it is executed
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:
Online mode, in the TSO foreground, using ISPF (Interactive System Productivity Facility) panels.
Batch mode using the TSO Terminal Monitor Program - IKJEFT01 (or IKJEFT1B)
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:Log on to TSO as you normally would. The ISPF main menu appears.
Choose Option 8 (DB2 - Perform DATABASE 2 Interactive Functions) in Cognizant Mainframe.
DB2I Main menu appears as shown in the following screenshot.
Following Options are available with DB2I:
SPUFI: SQL Processor Using File Input.
DCLGEN: Declaration Generator.
PROGRAM PREPARATION: Prepares a program containing embedded SQL for execution.
PRECOMPILE: Program containing embedded SQL is parsed to retrieve all SQL and replace it with calls to a runtime interface to DB2.
BIND/REBIND/FREE: Provides the capability to bind a DB2 plan & package, rebounda plan & package, remove plan & package from the system.
RUN: enables to run a DB2 application program.
DB2 COMMANDS: Enables to submit DB2 commands using TSO.
UTILITIES: Provides panels that ease the administrative burdens of DB2 utility processing.
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.
EXIT: Leaves DB2I
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!