Previous Topic: 3.2.1 Implementing DB2 Accounting

Next Topic: 3.3 Strategies for UNIX Accounting

3.2.2 Avoiding DB2 Duplicate Charging

Duplicate charging for CPU time can occur in DB2 when the
calling region is TSO, BATCH, or IMS because the CPU time
will be reported in the calling region as well as in DB2.

Special consideration must be given to charging for
DB2 CPU time when the calling region is CICS.

-- For DB2 Version 6 (and higher) and CICS CTS Version 2.2
   (and higher), duplicate charging can occur for CICS.
   Beginning with CTS 2.2, CICS regions exploit the IBM open
   transaction environment (OTE) to connect with DB2 and the
   DB2 CPU time is reported in the CICS transaction record as
   well as in DB2.

-- For DB2 Version 5 (or lower) or CICS CTS 2.1 (or lower),
   there is no issue with duplicate charging for CICS because
   the DB2 CPU time is NOT reported back to CICS calling
   regions.

If you charge for DB2 resource utilization from the ACTJDS
DB2 Resource Journal File and also charge for TSO, batch,
CICS, and/or IMS resource utilization from the journal files
associated with those components, then you must take care to
avoid duplicate charging for CPU times.

The standard computation codes whose associated data elements
contain DB2 CPU time follow.

   Comp   Data
   Code   Element    Description
   ----   -------    -----------------------------------
   1201   DSUTCBTM   TCB Time
   1203   DSUCPUTM   Accumulated CPU Time
   1206   DSUCPODB   CPU Time Only on a DB2 TCB

WARNING:  Beginning with DB2 Version 6, DB2 no longer
          records SRB CPU time for DB2 transactions. Since
          that DB2 release, DSUTCBTM and DSUCPUTM are equal.
          You should, therefore, never select both
          computation codes 1201 and 1203 for charging.

          In addition, for DSU file observations where the
          DB2PTASK data element has a value of ACUMAC, CHILD,
          or ROLLUP, or data element DSUCATYP has a value of
          7,8, or 12, DSUCPUTM and DSUCPUTM contain the save
          value.

          When you select both computation codes 1203 and
          1206 for charging, you need to only apply charges
          for computation code 1206 when the DB2PTASK value
          is not ACUMAC, CHILD, or ROLLUP, and DSUCATYP has a
          value other than 7, 8, or 12. Otherwise you will
          incur duplicate charging.

AVOIDING DUPLICATE CPU TIME CHARGES IN AN ENVIRONMENT WITH
SPECIAL PROCESSORS

There are two types of IBM special processors, zSeries
Application Assist Processor (zAAP) and z9 Integrated
Information Processor (zIIP).

For DB2 transactions, the portion of CPU time spent executing
on special processors (zIIP) is kept separate from the
portion of CPU time used by the transaction while executing
on a standard processor.  The CA MICS data element that
contains the special processor CPU time is:

 DSUCPUZ1 Accumulated CPU Time Consumed on zIIP

There are no duplicate charging issues for special processor
CPU times.

The CPU time spent by a transaction that could have executed
on a special processor, but executed on a standard CP because
a special processor was not available, is considered special
processor eligible CPU time.  Special processor eligible CPU
time is a subset of TCB CPU Time (DSUTCBTM) or CPU Time
(DSUCPUTM).  The CA MICS data element that contains
special processor eligible CPU time is:

 DSUELGZP Accumulated CPU Time zIIP-Eligible Work

There is a potential for duplicate charging for special
processor eligible CPU time if you want to use a different
rate for eligible CPU time than that used for work that had
to run on the standard processors.  It is important to
understand, that if you charge for both special processor
eligible CPU time and either the TCB or CPU time, you will be
charging for the special processor eligible CPU time twice.

If the desire is to charge the same rate for special
processor eligible CPU time as TCB CPU time, it is
recommended that you use the COMP codes for DSUTCBTM or
DSUCPUTM.

If you want to charge different rates for special processor
eligible CPU time and non-special processor eligible CPU time
or non-special processor eligible TCB time, use the following
computation codes:

o Special Processor Eligible CPU Time

COMP
CODE   Element    Label
----   --------   ------------------------------
1261  DSUELGZP   Accumulated CPU Time zIIP-Eligible Work

o CPU Time Excluding Special Processor Eligible CPU Time

COMP
CODE   Element    Label
----   --------   -----------------------------------
1262   DSUXSPTM   CPU Time Excluding Special CPU Time

The computation of DSUXSPTM is:

  DSUXSPTM = DSUCPUTM - DSUELGZP

WARNING:  Beginning with DB2 Version 10.1, supported by
          product change DB26790, the raw data used to
          populate data element DSUELGZP is no longer
          collected by DB2, so data element DSUELGZP is set
          to zero by CA MICS.

          Prior to DB2 Version 10.1, data element DSPXSPTM
          contained total CPU time (DSUCPUTM) minus
          speciality processor eligible CPU time (DSUELGZP).

          Beginning with DB2 Version 10.1, DSUCPUTM and
          DSUXSPTM will always be equal. To avoid duplicate
          charging, you should not charge for both the 1262
          (DSUXPSTM) and 1203 (DSUCPUTM) computation codes.

$SPAG
HOW TO AVOID DUPLICATE CHARGING

You can avoid duplicate charging for DB2 CPU time by using a
zero rate when the connection identifier (DB2CONN) is TSO,
BATCH, CICS (see notes above), or an IMS identifier.

This can be accomplished in Rate Table Algorithm
Specification by using control variable charging as follows:

 1) Assign DB2CONN to a DB2ACTn variable in
    sharedprefix.MICS.PARMS(DB2ACRT).

    Assigning DB2CONN to a DB2ACTn variable causes it to be
    available in the DAYS timespan, where charging occurs.

 2) Select Rate Table (Option 3;6 on the Installation
    Accounting Primary Options Menu), select the DB2 unit if
    necessary, and select the ACTJDS DB2 Resource Journal
    File.

 3) If you have not previously done so, select Option 1 and
    enter the file specifications.

 4) Select Algorithm Specification, Option 3, from the File
    Options menu and select each algorithm in turn.

 5) Enter DB2ACTn (where n is the number of the account code
    that contains DB2CONN) in the Control Variable column for
    the CPU time computation code.

 6) Enter the normal rate in the Rate column.

 7) Select the row to display the Variable Value
    Specifications panel.

 8) Enter rows with control variable values of TSO, BATCH,
    IMS (and CICS CTS Version 2.2 or higher and if DB2
    Version 6 or higher) identifiers, respectively, and rates
    of 0.

 9) END from Rate Table and submit MAGRUN when requested.

10) Repeat steps 1 through 9 for each additional DB2 unit.