TSO attachment facility

You can bind application plans and packages and run several online functions of DB2® through the TSO attachment facility. TSO also enables authorized DB2 users or jobs to create, modify, and maintain databases and application programs.

Using the TSO attachment facility, you can access DB2 by running in either foreground or batch. You gain foreground access through a TSO terminal; you gain batch access by invoking the TSO terminal monitor program (TMP) from a batch job.

Most TSO applications must use the TSO attachment facility, which invokes the DSN command processor. Two command processors are available:

DSN command processor
Provides an alternative method for running programs that access DB2 in a TSO environment. This processor runs as a TSO command processor and uses the TSO attachment facility.
DB2 Interactive (DB2I)
Consists of Interactive System Productivity Facility (ISPF) panels. ISPF has an interactive connection to DB2, which invokes the DSN command processor. Using DB2I panels, you can run SQL statements, commands, and utilities.

Whether you access DB2 in foreground or batch, attaching through the TSO attachment facility and the DSN command processor makes access easier. Together, DSN and TSO provide services such as automatic connection to DB2, attention-key support, and translation of return codes into error messages.

When using DSN services, your application must run under the control of DSN. You invoke the DSN command processor from the foreground by issuing a command at a TSO terminal. From batch, you first invoke TMP from within a batch job, and you then pass commands to TMP in the SYSTSIN data set.

After DSN is running, you can issue DB2 commands or DSN subcommands. However, you cannot issue a START DB2 command from within DSN. If DB2 is not running, DSN cannot establish a connection. A connection is required so that DSN can transfer commands to DB2 for processing.