Input and output data sets for DL/I batch jobs

DL/I batch jobs require an input data set with DD name DDITV02 and an output data set with DD name DDOTV02.

Db2 DL/I batch input:

Before you can run a DL/I batch job, you need to provide values for a number of input parameters. The input parameters are positional and delimited by commas.

You can specify values for the following parameters using a DDITV02 data set or a subsystem member:
SSN,LIT,ESMT,RTT,REO,CRC
You can specify values for the following parameters only in a DDITV02 data set:
CONNECTION_NAME,PLAN,PROG

If you use the DDITV02 data set and specify a subsystem member, the values in the DDITV02 DD statement override the values in the specified subsystem member. If you provide neither, Db2 abnormally terminates the application program with system abend code X'04E' and a unique reason code in register 15.

DDITV02 is the DD name for a data set that has DCB options of LRECL=80 and RECFM=F or FB.

A subsystem member is a member in the IMS procedure library. Its name is derived by concatenating the value of the SSM parameter to the value of the IMSID parameter. You specify the SSM parameter and the IMSID parameter when you invoke the DLIBATCH procedure, which starts the DL/I batch processing environment.

The meanings of the input parameters are:

SSN
Specifies the name of the Db2 subsystem. This value is required. You must specify a name in order to make a connection to Db2.

The SSN value can be from one to four characters long.

If the value in the SSN parameter is the name of an active subsystem in the data sharing group, the application attaches to that subsystem. If the SSN parameter value is not the name of an active subsystem, but the value is a group attachment name, the application attaches to an active Db2 subsystem in the data sharing group.

LIT
Specifies a language interface token. Db2 requires a language interface token to route SQL statements when operating in the online IMS environment. Because a batch application program can connect to only one Db2 system, Db2 does not use the LIT value.

The LIT value can be from zero to four characters long.

Recommendation: Specify the LIT value as SYS1.

You can omit the LIT value by entering SSN,,ESMT.

ESMT
Specifies the name of the Db2 initialization module, DSNMIN10. This value is required.

The ESMT value must be eight characters long.

RTT
Specifies the resource translation table. This value is optional.

The RTT can be from zero to eight characters long.

REO
Specifies the region error option. This option determines what to do if Db2 is not operational or the plan is not available. The three options are:
  • R, the default, results in returning an SQL return code to the application program. The most common SQLCODE issued in this case is -923 (SQLSTATE '57015').
  • Q results in an abend in the batch environment; however, in the online environment, this value places the input message in the queue again.
  • A results in an abend in both the batch environment and the online environment.

If the application program uses the XRST call, and if coordinated recovery is required on the XRST call, REO is ignored. In that case, the application program terminates abnormally if Db2 is not operational.

The REO value can be from zero to one character long.

CRC
Specifies the command recognition character. Because Db2 commands are not supported in the DL/I batch environment, the command recognition character is not used at this time.

The CRC value can be from zero to one character long.

CONNECTION_NAME
Represents the name of the job step that coordinates Db2 activities. This value is optional. If you do not specify this option, the connection name defaults are:
Type of application
Default connection name
Batch job
Job name
Started task
Started task name
TSO user
TSO authorization ID

If a batch update job fails, you must use a separate job to restart the batch job. The connection name used in the restart job must be the same as the name that is used in the batch job that failed. Alternatively, if the default connection name is used, the restart job must have the same job name as the batch update job that failed.

Db2 requires unique connection names. If two applications try to connect with the same connection name, the second application program fails to connect to Db2.

The CONNECTION_NAME value can be from one to eight characters long.

PLAN
Specifies the Db2 plan name. This value is optional. If you do not specify the plan name, the application program module name is checked against the optional resource translation table. If the resource translation table has a match, the translated name is used as the Db2 plan name. If no match exists in the resource translation table, the application program module name is used as the plan name.

The PLAN value can be from zero to eight characters long.

PROG
Specifies the application program name. This value is required. It identifies the application program that is to be loaded and to receive control.

The PROG value can be from one to eight characters long.

Example: An example of the fields in the record is shown below:
DSN,SYS1,DSNMIN10,,R,-,BATCH001,DB2PLAN,PROGA

Db2 DL/I batch output:

In an online IMS environment, Db2 sends unsolicited status messages to the master terminal operator (MTO) and records on indoubt processing and diagnostic information to the IMS log. In a batch environment, Db2 sends this information to the output data set that is specified in the DDOTV02 DD statement. Ensure that the output data set has DCB options of RECFM=V or VB, LRECL=4092, and BLKSIZE of at least LRECL + 4. If the DD statement is missing, Db2 issues the message IEC130I and continues processing without any output.

You might want to save and print the data set, as the information is useful for diagnostic purposes. You can use the IMS module, DFSERA10, to print the variable-length data set records in both hexadecimal and character format.