Running batch application programs
Batch Db2 work can run in the TSO background under the TSO terminal monitor program (TMP) or in an IMS batch message processing (BMP) region. IMS batch regions can issue SQL statements.
About this task
For batch work that runs in the TSO background, the input stream can invoke TSO command processors, particularly the DSN command processor for Db2. This input stream can include DSN subcommands, such as RUN.
Example
The following example shows a TMP job:
//jobname JOB USER=SYSOPR ...
//GO EXEC PGM=IKJEFT01,DYNAMNBR=20
.
user DD statements
.
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD *
DSN SYSTEM (ssid)
.
subcommand (for example, RUN)
.
END
/*In this example:
- IKJEFT01 identifies an entry point for TSO TMP invocation. Alternative
entry points that are defined by TSO are also available to provide
additional return code and abend termination processing options. These
options permit the user to select the actions to be taken by the TMP
on completion of command or program execution.
Because invocation of the TSO TMP using the IKJEFT01 entry point might not be suitable for all user environments, refer to the TSO publications to determine which TMP entry point provides the termination processing options that are best suited to your batch execution environment.
- USER=SYSOPR identifies the user ID (SYSOPR in this case) for authorization checks.
- DYNAMNBR=20 indicates the maximum number of data sets (20 in this case) that can be dynamically allocated concurrently.
- z/OS® checkpoint and restart facilities do not support the execution of SQL statements in batch programs that are invoked by the RUN subcommand. If batch programs stop because of errors, Db2 backs out any changes that were made since the last commit point.
- (ssid) is the subsystem name or group attachment name.