Techniques for debugging programs in IMS

Documenting the errors that are identified during testing of an IMS application helps you investigate and correct problems in the program.

The following information can be useful:
  • The application plan name for the program
  • The input message that is being processed
  • The name of the originating logical terminal
  • The failing statement and its function
  • The contents of the SQLCA (SQL communication area) and, if your program accepts dynamic SQL statements, the SQLDA (SQL descriptor area)
  • The date and time of day
  • The PSB name for the program
  • The transaction code that the program was processing
  • The call function (that is, the name of a DL/I function)
  • The contents of the PCB that the program call refers to
  • If a DL/I database call was running, the SSAs, if any, that the call used
  • The abend completion code, abend reason code, and any dump error messages

When your program encounters an error, it can pass all the required error information to a standard error routine. Online programs can also send an error message to the originating logical terminal.

An interactive program also can send a message to the master terminal operator (MTO) operator giving information about the termination of the program. To do that, the program places the logical terminal name of the master terminal in an express PCB and issues one or more ISRT calls.

Some organizations run a BMP at the end of the day to list all the errors that occurred during the day. If your organization does this, you can send a message by using an express PCB that has its destination set for that BMP.

Batch Terminal Simulator: The Batch Terminal Simulator (BTS) enables you to test IMS application programs. BTS traces application program DL/I calls and SQL statements, and it simulates data communication functions. It can make a TSO terminal appear as an IMS terminal to the terminal operator, which enables the user to interact with the application as though it were an online application. The user can use any application program that is under the user's control to access any database (whether DL/I or Db2) that is under the user's control. Access to Db2 databases requires BTS to operate in batch BMP or TSO BMP mode.