Accounting CLASS 1 processor time

For CLASS 1, a task processor timer is created when the TCB is attached. When a thread to DB2® starts, the timer value is saved. When the thread is terminated, or the authorization ID is changed, the timer is checked again and both the timer start and end values are recorded in the SMF type 101 record.

In Figure 1, CLASS 1 is the sum of the times 3, 6, and 9. In Figure 2, CLASS 1 is the sum of the times 3, 4, 6, 7, 9, and 10.

The fields in the SMF type 101 record, the DB2 accounting record, used for accounting CLASS 1 processor time are:
  • QWACBJST for begin thread TCB time
  • QWACEJST for end thread TCB time
  • QWACBSRB for begin ASCB SRB time
  • QWACESRB for end ASCB SRB time.
You can find a description of the contents of the DB2 accounting record in Managing Db2 performance in Db2 for z/OS product documentation. There is also the description of accounting record fields in member DSNWMSGS, which is shipped in SDSNSAMP.
When CLASS 1 recording becomes active for a thread, it is recording time spent on the L8 open TCB. Because the L8 TCB is used for both CICS® activity and DB2 activity, this includes processor time spent in the CICS-DB2 attachment facility, including trace calls. It also includes processor time spent running application code (if the application is threadsafe) and threadsafe CICS commands on the open TCB. If a thread is reused, the thread housekeeping processor time is also included in the CLASS 1 processor time. As in previous releases, there is a proportion of thread creation and thread termination processing that is not captured by CLASS 1 time. The CLASS 1 processor time does not include any time spent running application code on the QR TCB, which happens as follows:
  • In the initial period before the application issues its first EXEC SQL request and moves on to the open TCB (time 1 in the figure). This initial application code runs on the CICS main TCB, and is not seen by DB2 accounting.
  • If the application issues a CICS command that is not threadsafe. This forces processing to move back to the CICS main TCB. The application code then continues to run on the CICS main TCB, where it cannot be seen by DB2 accounting, until the application issues its next EXEC SQL request. At this point, processing can move back onto the open TCB.

Unless you are using DB2 sysplex query parallelism (parallel query), you do not need to use the DB2 CLASS 1 processor time for accounting purposes. The processor time recorded in the CICS SMF type 110 record is all that is required to give a complete account of the processor time consumed by an application. This record includes the time spent in the application code, the thread creation and termination costs, and the time covered by the DB2 CLASS 1 processor time. For more information, see Calculating CICS and DB2 processor times for DB2.