Previous Topic: 7.2.1 Account Code Specification (TSOACCT)

Next Topic: 7.2.3 Analyzer Definition Statements (TSOGENIN)

7.2.2 Account Code Exit Routine (TSOACRT)


An account code exit routine tells CA MICS how to assign
values to the fields defined by the account code
specification.  The routine is invoked to build the elements
TSOACTn, where n is the account code level.  For example, if
TSOACCT defines three account code levels, TSOACRT builds the
elements TSOACT1, TSOACT2, and TSOACT3.

The routine sets the values of all TSOACTn variables in the
following files:

    o  TSO User Activity File (TSOTSU)
    o  TSO User Command Counts File (TSOTSC)
    o  TSO User Interactive Usage File (TSOTSI)
    o  TSO Batch User Activity File (TSO_BU)
    o  TSO Batch User Command Counts File (TSO_BC)
    o  TSO Batch Command Information File (TSO_BI)

Code the account code exit routine in SAS and verify that it
is correct.  A sample TSOACRT member is provided in
sharedprefix.MICS.PARMS(TSOACRT).  Refer to Section 2.3.1.5,
Notes on Coding CA MICS Parameters, in the CA MICS Planning,
Installation, Operation, and Maintenance Guide for coding
help.  Figure 7-2 provides a worksheet for coding your
routine.


PREPARATION

The CA MICS TSO Analyzer provides a sample account code exit
routine and certain program aids to help you verify the
accuracy of any modifications you make to the routine.  You
can use each of the elements in the TSOTSI and TSOTSC files
for deriving account code information for commands.  For each
user, all the elements in the TSOTSU file are available.  The
TMPBATCH element can be used to determine the source of the
information being processed.  A value of zero indicates
online TSO information while a value of one indicates batch
TSO information.  TMPBATCH is available at execution time,
but is not retained in the data base files.

Exits to the account code derivation routine are provided at
the point just prior to the creation of records in these
files.  If the assignment of account codes depends on the
specific invocation of the routine, the variable SMFRTYPE,
which identifies the SMF record type, can be tested.
SMFRTYPE will have a value equal to that contained in
variable K199 if the routine has been invoked for TSOTSI and
TSO_DBI records, and equal to variable K200 if the routine
has been invoked for TSOTSU, TSOTSC, TSO_DBU, and TSO_DBC
records.

The data element that is most often used to determine the
account code value is USER (User ID).  In addition, you can
use five variables, ACTFLD1 through ACTFLD5, which contain
the first five levels of the MVS accounting information.

NOTE:  The ACTFLD1 through ACTFLD5 variables are not stored
in the data base and are only present when the input data
source is TSO/MON Release 5.0 or higher.


EXAMPLES

Example 1:

The following example assumes that an installation has
defined two account code levels in sharedprefix.MICS.PARMS
member TSOACCT and that they are derived as follows:

    TSOACT1 - is the first three characters of the user ID.

    TSOACT2 - is the second four characters of the user ID.

An overhead category is defined for each account code level.
The TSOACCT member for the account definition would be:

    1 3 'DIVISION'
    2 4 'USER'

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

/*---------------------------------------------------------*/
/*                                                         */
/* SAMPLE TSO ACCOUNT CODE DERIVATION EXIT                 */
/*                                                         */
/*  DIVISION IS BUILT FROM POSITIONS 1-3 OF USER ID.       */
/*                                                         */
/*  USER IS BUILT FROM POSITIONS 4-7 OF USER ID.           */
/*                                                         */
/*                                                         */
/*  NOTE: ANY DATA ELEMENT IN THE DATA SET ALLOCATION FILE */
/*        CAN BE USED IN DERIVING THE ACCOUNT CODES.       */
/*        ADDITIONALLY, THE FOLLOWING VARIABLES ARE        */
/*        AVAILABLE WHEN THE INPUT DATA SOURCE IS          */
/*        TSO/MON RELEASE 5.0 OR HIGHER:                   */
/*                                                         */
/*        ACTFLD1-ACTFLD5 ARE VARIABLES THAT CONTAIN THE   */
/*        FIRST FIVE LEVELS OF MVS ACCOUNTING INFORMATION, */
/*        RESPECTIVELY.                                    */
/*                                                         */
/*---------------------------------------------------------*/
     IF LENGTH(USER) LT 3 THEN TSOACT1 = '***';
     ELSE TSOACT1 = SUBSTR(USER,1,3);
     IF LENGTH(USER) LT 7 THEN TSOACT2 = '****';
     ELSE TSOACT2 = SUBSTR(USER,4,4);




Example 2:

In the next example, the MVS accounting information fields
for the TSO logon session as recorded by TSO/MON (Release 5.0
and higher) are assigned to the TSOACTn variables.  The
TSOACCT member for the account definition for this example
is:

    1 10 'DIVISION'
    2 10 'USER'

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

/*---------------------------------------------------------*/
/*                                                         */
/* SAMPLE TSO ACCOUNT CODE DERIVATION EXIT                 */
/*                                                         */
/*  IN THIS EXAMPLE, TWO ACCOUNT CODES ARE DEFINED.        */
/*                                                         */
/*  DIVISION AND USER ARE BUILT FROM THE FIRST TWO LEVELS  */
/*  OF MVS ACCOUNTING INFORMATION.  THIS INFORMATION IS    */
/*  ONLY PRESENT WHEN THE INPUT DATA SOURCE IS TSO/MON     */
/*  RELEASE 5.0 AND HIGHER.                                */
/*                                                         */
/*---------------------------------------------------------*/
  IF TSMONVER GE '50' THEN DO;
     TSOACT1=ACTFLD1;
     TSOACT2=ACTFLD2;
  END;


Use the worksheet in Figure 7-2 to code your account code
exit routine (TSOACRT).




                            +--------------------------------------------------------------------------+
                            | INSTALLATION PREPARATION WORKSHEET: Account Code Routine Definition      |
                            |                                                                          |
                            | PARMS Library Member is TSOACRT                                          |
                            | Reference: Section 7.2.2 - CA MICS TSO Analyzer Guide                    |
                            +--------------------------------------------------------------------------+
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            |                                                                          |
                            | ________________________________________________________________________ |
                            +--------------------------------------------------------------------------+
                            | ....5...10...15...20...25...30...35...40...45...50...55...60...65...70.. |
                            +--------------------------------------------------------------------------+

Figure 7-2. TSO Account Code Exit Routine Worksheet