Previous Topic: 7.1.1.1 Account Code Definition (VMCACCT)

Next Topic: 7.1.1.3 Account Code Derivation for Linux Exit (LNXACRT)

7.1.1.2 Account Code Derivation Exit (VMCACRT)


This section explains how to code an account code exit for
the CA MICS Analyzer for VM/CMS.  These definitions will be
used for every database unit that contains the Analyzer in
the database complex.

An Account Code Exit Routine is a user-written routine that
is invoked for each input record processed.  This SAS routine
builds the account code data elements defined in the previous
section.  For example, if the VMCACCT member in
sharedprefix.MICS.PARMS defines four account code levels,
this user routine has the responsibility of building the data
value of those four fields for each record processed.

The user account code routine is written in SAS code.  The
testing and accuracy of the process is the responsibility of
the user.  However, the CA MICS Analyzer Option for VM/CMS
provides a sample Account Code Exit Routine to help verify
the accuracy of the user modifications to the routine.  The
worksheet for structuring the Account Code Exit Routine is
shown in Figure 7-2.

Each of the data elements contained in the User Resource
Accounting File (VMCCMU), Device Accounting File (VMCDAC),
RSCS Accounting File (VMCVRA), or Terminal Network Usage File
(VMCNTU) is available for use by the Account Code Exit
Routine.  The account code exit can determine which file it
has access to by examining the element WRK_NAME.  WRK_NAME is
set to the name of the file accessed, that is, VMCCMU,
VMCDAC, VMCVRA, or VMCNTU.  Refer to the appropriate section
in Chapter 5 for a list of the elements that are available
for use.

Data elements frequently used to determine account code
values are:

USER    -  VM Userid
VMCACNT -  CP Account Code

In the VMCNTU file, USER is either a VM userid or a terminal
identification.

The object of the account code derivation process is to build
the data elements VMCACT1 to VMCACT9 (as many as have been
defined in VMCACCT) from the data made available in the VMC
detail data.  Follow the exit coding guidelines given in
Section 2.3.1.5, Notes on Coding CA MICS Parameters, in
Chapter 2 of the PIOM.

This example assumes that you have defined three account code
levels in the VMCACCT parms member that are derived as
described below:

VMCACT1 - Corporate Division
VMCACT2 - Region within the Division
VMCACT3 - Project

The VMCACCT member for the account definition would be:

1 8 'DIVISION'
2 8 'REGION'
3 8 'PROJECT'

+--------------------------------------------------------------------------+ | INSTALLATION PREPARATION WORKSHEET: VM Account Code Exit | | | | PARMS Library Member is VMCACRT | | Reference Sections: 7.1 CA MICS VM Component Guide | +--------------------------------------------------------------------------+ | | | * VALIDATE FOR VALID ACCOUNT CODES, WHERE POSSIBLE ; | | | | IF { account data is valid } THEN DO; | | | | * BUILD ACCOUNT CODE FIELDS AS IN THE WORKSHEET 7-1 | | | | VMCACT1=field source 1 ; | | ... | | ... | | ... | | VMCACTn=field source n ; | | ____________________________________________________________________ | | ____________________________________________________________________ | | ____________________________________________________________________ | | ____________________________________________________________________ | | ____________________________________________________________________ | | | | END; | | ELSE DO; | | | | * ROUTINE TO BUILD INSTALLATION OVERHEAD ACCOUNT CODES ; | | | | VMCACT1='overhead category' ; | | ... | | ... | | ... | | VMCACTn='overhead category' ; | | ____________________________________________________________________ | | ____________________________________________________________________ | | ____________________________________________________________________ | | ____________________________________________________________________ | | | | END; | | | +--------------------------------------------------------------------------+ | ....5...10...15...20...25...30...35...40...45...50...55...60...65...70.. | +--------------------------------------------------------------------------+


 Figure 7-2. Account Code Routine Definition Worksheet

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

* ABC'S  ACCOUNT CODE DERIVATION EXIT
*
*  THE VM USERID (USER) IS THE SOURCE OF INFORMATION
*  FOR THE ACCOUNT CODES
*
*   IF THE FIRST TWO CHARACTERS OF USER ARE NOT EQUAL TO
*       'DE', 'PR' OR 'TS', OR THE REGION IS BLANK, THE
*       ACCOUNT CODES ARE SET TO THE INSTALLATION
*       OVERHEAD ACCOUNT CODES.
*;

    VMCACT1=SUBSTR(USER,1,2) ;
    VMCACT2=SUBSTR(USER,3,2) ;

    IF (VMCACT1 NE 'DE' AND
        VMCACT1 NE 'PR' AND
        VMCACT1 NE 'TS') OR
        VMCACT2 EQ ' '   OR
        VMCACT2 EQ '00'X
      THEN DO;
       VMCACT1='**';
       VMCACT2='*';
       VMCACT3='   ';
    END;
    ELSE VMCACT3 = SUBSTR(USER,4,5);