Previous Topic: 7.2.2 IMS Account Code Structure (IMSACCT)Next Topic: 7.3 Unit-Level Parameters


7.2.3 Code the IMS Account Code Exit (IMSACRT)

An IMS Account Code Derivation Routine is a user-written SAS
routine, located in sharedprefix.MICS.PARMS(IMSACRT), that is
invoked for each transaction processed.  This routine builds
the account code data elements defined in the previous
section.  For example, if the IMSACCT member in the
sharedprefix.MICS.PARMS library defines four account code
levels, this routine must build the data values for those
four fields for each transaction processed.

While you are responsible for writing, testing, and ensuring
the accuracy of the routine for your site's needs, the
CA MICS IMS Analyzer provides a sample account code exit
routine and a worksheet, shown in Figure 7-2, to help you.

In coding the routine, you can use each of the data elements
contained in the IMS monitor data collection record.  The
data elements most often used to determine the account code
value are:

    TRANSACT  - The IMS transaction ID
    RACFUSID  - The RACF user identification
    LTERM     - The IMS logical terminal identifier
    PSBNAME   - The IMS program specification block name
    TRANTYPE  - C/S/M/L/X for conversational, short, medium,
                long and excessive transaction types
    TRANUSER  - The transaction user (from type FA records)
    ISUITYPE  - M for MPP transactions
                B for BMP transactions
                C for conversational transactions
                F for Fastpath message driven transactions
                N for Fastpath non-message driven transacts
                U for Fastpath utilities
                E for Explicit APPC (IMS 4.1 and higher)
                D for DBCTL transactions
                (blank) the execution method cannot be
                   determined.


Type 1 log records for data created by the IMS FORMAT command
report the message destination rather than the transaction
identifier.  In coding parameter exits, consider testing for
format records (IF TRANXORG=F) and handling them by setting
the transaction name to the transmission identifier (THEN
TRANSACT=TRANSMID).

Assume that the installation has defined three account code
levels in the IMSACCT member and they are derived as
described below:

    IMSACT1 is the first 2 characters of the transaction ID
    IMSACT2 is the last character of the logical terminal ID
    IMSACT3 is the first 3 characters of PSBNAME

Furthermore, the values of IMSACT1 may only be 'DE', 'PR', or
'TS'.

The IMSACCT member for the account definition would be:

    1 2 'DIVISION'
    2 1 'REGION'
    3 3 'USER'

The SAS code defined for the user account code exit would be
as follows:


* ABC'S  IMS ACCOUNT CODE DERIVATION EXIT
*
*  DIVISION IS BUILT FROM POSITIONS 1-2 OF THE TRANSID.
*  REGION IS BUILT FROM THE LAST POSITION OF THE TERMINAL ID.
*  USER IS BUILT FROM POSITIONS 1-3 OF THE PSBNAME.
*
*   IF THE DIVISION IS NOT EQUAL TO DE, PR, OR TS,
*       THE CODE IS INVALID AND THE ACCOUNT CODES SHOULD
*       BE SET TO THE INSTALLATION OVERHEAD ACCOUNT CODES.
*
*   IF NO TRANS ID, THEN ASSUME AN OVERHEAD TRANSACTION.
*
*
   ;
    IMSACT1=SUBSTR(TRANSACT,1,2) ;
    IF IMSACT1 NE 'DE' AND IMSACT1 NE 'PR'
    AND IMSACT1 NE 'TS' THEN GOTO ACCTOVHD ;
    LENTERM=LENGTH(LTERM) ;
    IMSACT2=SUBSTR(LTERM,LENTERM,1) ;
    IF IMSACT2=' ' OR IMSACT2='00'X THEN GOTO ACCTOVHD ;
    IMSACT3=SUBSTR(PSBNAME,1,3) ;
    GOTO ACCTRTEX ;

ACCTOVHD:
    IMSACT1='**' ;
    IMSACT2='*' ;
    IMSACT3='   ' ;
ACCTRTEX:

Users billing for batch jobs from the Batch and Operations
Analyzer should exclude their IMS transactions that run as
batch jobs, called BMPs, which also generate IMS transaction
data.

The most effective process for excluding BMP activity is to
include ISUITYPE in an IMSACTx field.  Then, IMSACTx can be
used by CA MICS Accounting and Chargeback to generate
charges.  It is possible to exclude charging for batch jobs
in SMF if the IMS BMP jobname or account information is
unique and identifiable.

The IMSISU and IMS_IS files are summarized at the DAYS and
higher timespans and ISUITYPE, which identifies billable
transactions (ISUITYPE = 'B'), is not summarized to these
timespans.

Since ISUITYPE is not retained in the DAYS timespan as a
sort and sequence variable, the element ISUITYPE must be
assigned to an IMSACTn element in IMSACRT.  You can keep this
IMSACTn element at the DAYS level, if desired, or at all
supported timespans, to identify billable transactions at
all levels of CA MICS summarization.

To retain ISUITYPE in an IMSACTn element at only the DAYS
timespan, include the additional account code definition
with the TIMESPAN mask in the IMSACCT member, as follows:

  1           8 'Division'
  2           8 'Transaction Code'
  3 T(YYNNNY) 4 'B for BMP or blank'

The T(YYNNNY) parameter is described in Section 2.3.1.7 of
the PIOM.  The example above shows the third IMSACTn element
being retained only at the DETAIL level (if turned on) and
the DAYS timespan.   The IMSACT3 element would not be present
in the WEEKS, MONTHS, or YEARS timespans, if active.

Furthermore, if you want to activate the new element and only
retain it through the DAYS timespan, you do not need to
retrofit existing WEEKS "00" cycles (if activated) or MONTHS
"00" cycles.

The required steps are:

1) Update the sharedprefix.MICS.PARMS(IMSACCT) member to
    include the additional IMS Account Code definition and
    the TIMESPAN mask.

2) Update sharedprefix.MICS.PARMS(IMSACRT) to assign
    IMSACTn's value to ISUITYPE if ISUITYPE = 'B' or set
    IMSACTn to blanks.

3) Submit sharedprefix.MICS.CNTL(IMSCGEN).

4) If the new IMS Account Code element is to be retained at
    any timespan higher than DAYS, the 00 cycles of WEEKS,
    MONTHS, and possibly YEARS must be retrofitted to include
    the new element in the file.  A simple DATA step to add
    the element with a default length would work.  If the
    element is to be retained only up to DAYS, no retrofit is
    required.  Refer to the CA MICS System Modification
    Guide, Section 6.3 for retrofit coding samples.





                           +--------------------------------------------------------------------------+
                           | INSTALLATION PREPARATION WORKSHEET: IMS Account Code Routine Definition  |
                           |                                                                          |
                           | PARMS Library Member is IMSACRT                                          |
                           | Reference Sections: 7.2.3                                                |
                           +--------------------------------------------------------------------------+
                           |                                                                          |
                           | * VALIDATE FOR VALID ACCOUNT CODES, WHERE POSSIBLE ;                     |
                           |     IF account data is not valid GOTO ACCTOVHD ;                         |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | * BUILD ACCOUNT CODE FIELDS AS IN WORKSHEET 7-1;                         |
                           |     IMSACT1=field source 1 ;                                             |
                           |     IMSACTn=field source n ;                                             |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           |     GOTO ACCTRTEX ;                                                      |
                           | * LINKED ROUTINE TO BUILD INSTALLATION OVERHEAD ACCOUNT CODES ;          |
                           | ACCTOVHD:                                                                |
                           |     IMSACT1='overhead category' ;                                        |
                           |     IMSACTn='overhead category' ;                                        |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ACCTRTEX:                                                                |
                           +--------------------------------------------------------------------------+
                           | ....5...10...15...20...25...30...35...40...45...50...55...60...65...70.. |
                           +--------------------------------------------------------------------------+

Figure 7-2. IMS Account Code Routine Definition Worksheet