Previous Topic: 3.7.1 Avoiding Web Duplicate ChargingNext Topic: 3.8 Implementing Client/Server Accounting


3.7.2 Avoiding MQSeries Duplicate Charging


There are two ways you can incur duplicate charges for
MQSeries.  One is by charging for the same activity twice
using the MQSeries journal files.  The second is by charging
for MQSeries CPU time from MQSeries files as well as from log
or transaction records from connecting address spaces.

The MQSeries files that can be used for Accounting and
Chargeback are:

  MQAMMA - Message Manager Accounting File
  MQATAA - Task Accounting File
  MQAQAA - Queue Activity File
  MQBMFA - Message Flow Accounting File

The journal files and standard computation codes for MQSeries
CPU time are listed here:

   Comp   MQS     Journal  Data
   Code   File    File     Element   Description
   ----   ------  ------   --------  ---------------------
   2702   MQAMMA  ACTJMQ   MMACPUTM  CPU Time Used
   2730   MQATAA  ACTJTA   TAACPUTM  Total CPU Time
   2738   MQAQAA  ACTJQA   QAAQCPTM  Total Queue CPU Time
   2740   MQBMFA  ACTJMF   MFACTM    MQSeries Message Flow
                                     Total CPU Time


Avoiding Duplicate Charging within the MQSeries Component
---------------------------------------------------------
If you charge for WebSphere MQ using two or more of the
journal files listed above, you must make sure that you are
not charging for the same activity twice.  If two different
versions of MQSeries are running, there might be a need to
charge from both the MQAMMA and MQATAA files.  Since only the
MQAMMA file was available at MQSeries Version 2.1, only the
ACTJMQ journal file would have been used for that version.
Since all four files are available at version 5.2 and
higher, it is possible to charge for activity from any of the
four journal files.  Refer to section 3.10 for more
information about these four data sources and their journal
files.

Avoiding Duplicate Charging Between CA MICS Components
------------------------------------------------------
Duplicate charging can occur for WebSphere MQ when a
connecting address space is TSO, Batch, or IMS because the
MQSeries CPU time is reported in both the MQSeries
transaction records as well as in the type 30 or transaction
records from the the connecting address spaces.  If you are
charging for CPU usage for TSO, Batch, or IMS from other
journal files, then you should not be charging for CPU usage
from a MQSeries file.

For CICS releases below CICS/TS 3.2, there is no duplication
between WebSphere MQ CPU time as reported for CICS in the
MQSeries records and as reported in the CICS transaction
records.  However, beginning with CICS/TS 3.2, CICS
transaction records report the same CPU time that is reported
in the MQSeries records.  Thus the following elements from
the CICS User Activity (CICCSU) file duplicate CPU activity
reported for MQSeries:

  CSUCPRTM  - Task CPU Real Time
  CSUCPUTM  - Task CPU Time
  CSUTCBTM  - TCB CPU Time

For all CICS releases, the CPU time reported in SMF type 30
address space records for CICS regions overlaps with the CPU
time reported in MQSeries transaction records.


Charging for Message Processing in the MQ CHIN Channel
------------------------------------------------------
Another activity for possible chargeback is the message
processing handled by the WebSphere MQ CHIN channel address
space.  The CHIN address space processes messages to and from
applications outside the z/OS environment.  The CPU time used
to process each message is recorded in task and queue records
where MQSATYP=6 (channel activity).  This CPU activity is
also recorded in the CHIN SMF type 30 address space record,
but the individual task and queue records are more suitable
for chargeback because the specific channel name is available
for identification purposes.


HOW TO AVOID DUPLICATE CHARGING

You can avoid duplicate charging for MQSeries CPU time by
using a zero rate when the connection type is TSO, Batch, or
IMS.  When the connection type is CICS/TS 3.2 and above, also
use a zero rate.  To identify connection types, use the Type
of Connection (MQSATYP) element, which has the following
possible values:

  1 - CICS
  2 - Batch or TSO
  3 - IMS Control Region
  4 - IMS, MPP, or BMP
  5 - Command Server
  6 - Channel Initiator
  7 - Resource Recovery Services (RRS) Batch
  8 - Intra-Group Queuing (IGQ) Agent

The following checklist should be followed so that you can
use Control Variable Charging to avoid duplicate charges.

 1) Select Rate Table (Option 3;6 on the Installation
    Accounting Primary Options Menu), select the MQS unit if
    necessary, and select the MQSeries journal file you want
    to use for chargeback.

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

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

 4) Enter a Control Variable data element for the CPU time
    computation codes that you are using.  There would be a
    Control Variable only in those cases where you know that
    the CPU time is being charged outside of MQSeries.

    - The MQSATYP element can be used directly as the Control
      Variable.  Select each computation code and assign a
      zero rate for each MQSATYP value that will have a
      duplicate charge in another algorithm.  You would likely
      assign a rate of zero to the following MQSATYP values:

        1 (CICS/TS 3.2 and above)
        2 (Batch or TSO)
        3 (IMS Control Region)
        4 (IMS, MPP, OR BMP)
        6 (Channel Initiator)

    - As an alternative, you can create an element that has a
      value of one (1), meaning charge, or zero (0), meaning
      don't charge.  The example shown in
      sharedprefix.MICS.HOLD.PARMS(COSTRTE) creates a data
      element ACTMQSFG that assigns a one or zero based on
      MQSATYP.  If you used this sample code, ACTMQSFG would
      be your Control Variable data element.  Be aware that
      the sample code in the COSTRTE should also include a
      reference to CICS for CICS/TS 3.2 and above.
      Therefore, the code in COSTRTE should be changed to the
      following:

      IF MQSATYP=1 OR MQSATYP=2 OR MQSATYP=3 OR MQSATYP=4
      THEN ACTMQSFG=0;
      ELSE ACTMQSFG=1;

      Also, if you are charging for CPU time from the CHIN
      SMF type 30 record, then you need to include MQSATYP=6
      as part of the condition (IF) in the above expression.
      If you are using ACTMQSFG as the Control Variable then
      assign a rate of 0 to all observations that have the
      following value:

      0 (All non-billable records)

    *********************************************************
    **  Make sure you set the rate to zero for each row    **
    **  entered for the Charging Element.                  **
    *********************************************************

 5) Enter the normal rate in the Rate column for the row that
    displays the computation code.  This rate will be applied
    in all cases that are not covered by the Control
    Variable.

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

 7) Repeat steps 1 through 6 for each additional MQS unit.