Previous Topic: 7.1.2.1 Account Code Structure (TLMACCT)Next Topic: 7.1.2.3 Analyzer Definition Statements (TLMGENIN)


7.1.2.2 Account Code Derivation Exit (TLMACRT)


After you use TLMACCT to define the account codes, your next
step is to code the Account Code Derivation Exit member
sharedprefix.MICS.PARMS(TLMACRT).

TLMACRT assigns values to the account code data elements
during the DAY091 step.  For example, if you have defined
four account codes in TLMACCT, the TLMACRT exit must contain
SAS code to assign values to the data elements TLMACT1,
TLMACT2, TLMACT3, and TLMACT4 -- for each DETAIL record
processed.

Some sample exit coding techniques are provided here to give
you ideas for adapting your own routine, but you are
responsible for testing the accuracy of the exit routine.


Each data element in the DETAIL timespan of the TLMTLD file
can be referenced by the TLMACRT code to assign account code
values.  Most sites use data set name qualifiers (nodes) to
determine organizational ownership, but additional
information such as the job name that created the data set
and the tape volume serial number are available for account
code assignment.

If you currently use the CA MICS Space Analyzer Option to
manage DASD data sets, you may already have determined
methods to assign organizational ownership based on data set
naming conventions.  If so, you should review the
sharedprefix.MICS.PARMS(VCAACRT) account routine for
techniques and conventions that may be applicable to tape
data set ownership determination.

For convenience, several temporary variables are created that
can be referenced by your routine:

  DSNODE1 - First node of the tape data set name
            (often referred to as the high level qualifier)
  DSNODE2 - Second node of the tape data set name
  DSNODE3 - Third node of the tape data set name
  DSNODE4 - Fourth node of the tape data set name
  DSNODE5 - Fifth node of the tape data set name
  DSNODEL - Last node of the tape data set name

Notes:

1. DSNODE1 to DSNODE5 and DSNODEL are not permanent data
   elements.  They are created for your coding convenience to
   examine the various nodes of the data set name (DSNAME)
   for the current observation.

   DSNODE1 to DSNODE5 contain the first five nodes of the
   DSNAME.  DSNODEL contains the last node of the DSNAME.

   A sample DSNAME would be coded as follows:

   SYS1.DATA.TELPIN.G0001V00

   where:

   DSNODE1='SYS1'     DSNODE2='DATA'    DSNODE3='TELPIN'
   DSNODE4='G0001V00' DSNODE5=' '       DSNODEL='G0001V00'

2. The TLMACRT exit may contain any valid SAS statements for
   a data step except RETURN and DELETE.  Coding either of
   these two statements may cause unpredictable results in
   DAILY processing, since the input processing is performed
   within a loop, and control is not returned to the
   beginning of the DATA step for each record input.

3. A best practice is to assign default account code values
   to all account code data elements at the start of the
   routine.  These default values will be over-written with
   correct values according to your account routine logic.
   This approach provides you with two benefits.

   o It groups observations where proper account codes cannot
     be determined under the same default category and,
     therefore, requires less DASD space for storing the TLM
     component files.

   o It enables you to determine the quantity of
     uncategorized activity.  This quantity can be tracked
     over time as you refine and update your TLMACRT to
     correctly categorize all tape data set records.

TLMACRT Coding Example 1
------------------------

A site has established the following data set naming
conventions:

o The three characters of the first node of a data set name
  represent the company division (TLMACT1).

o The first six characters of the second node of a data set
  name represent the company department (TLMACT2).

o The third node of the data set name tells how to derive the
  userid (TLMACT3).

  - If the third node begins with 'X' or 'Z,' the USERID
    is the fourth node.

  - Otherwise, the USERID is populated with the overhead
    value of '*******'.

In Example 1, assume that you have defined all nine account
code levels in TLMACCT, but are only populating three at this
time.  You intend to populate TLMACT1-TLMACT3 as follows:

o TLMACT1 is set to the value of the first three characters
  of the high-level node of the data set name.

o TLMACT2 is set to the first six characters of the second
  node of the data set name.

o TLMACT3 is set to the value of the fourth node of the data
  set name if the third node begins with the characters 'X'
  or 'Z'.

The TLMACCT member for the account definition is as follows:

1 3 'DIVISION'
2 6 'DEPARTMENT'
3 8 'USERID'

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

/*---------------------------------------------------------*/
/*                                                         */
/* SAMPLE TLM ACCOUNT CODE DERIVATION EXIT                 */
/*                                                         */
/*  DIVISION IS BUILT FROM POSITIONS 1-3 OF NODE ONE OF    */
/*  THE DATA SET NAME.                                     */
/*                                                         */
/*  DEPARTMENT IS BUILT FROM POSITIONS 1-6 OF NODE TWO OF  */
/*  THE DATA SET NAME.                                     */
/*                                                         */
/*  USER IS BUILT FROM THE FOURTH NODE IF THE THIRD NODE   */
/*  OF THE DATA SET NAME BEGINS WITH 'X' or 'Z'.           */
/*                                                         */
/*  DSNODE1-DSNODE5 ARE VARIABLES THAT CONTAIN THE FIRST   */
/*  FIVE NODES OF THE DATA SET NAME RESPECTIVELY.          */
/*                                                         */
/*---------------------------------------------------------*/
/*                                                         */
/* SET DEFAULT VALUES                                      */
/*                                                         */
    TLMACT1 = '***' ;
    TLMACT2 = '******' ;
    TLMACT3 = '********' ;
/*                                                         */
/*  GET DIVISION                                           */
/*                                                         */
    TLMACT1 = SUBSTR(DSNODE1,1,3) ;
/*                                                         */
/*  GET DEPARTMENT  (MAKE SURE DATA SET HAS A 2ND NODE)    */
/*                                                         */
    IF DSNODE2 NE ' ' THEN TLMACT2 = SUBSTR(DSNODE2,1,6);
/*                                                         */
/*  GET USERID IF 3RD NODE BEGINS WITH 'X' OR 'Z'          */
/*                                                         */
    IF DSNODE3 NE ' ' THEN DO ;
      IF DSNODE3 EQ: 'X' OR DSNODE3 EQ: 'Z' THEN DO ;
        IF DSNODE4 NE ' ' THEN TLMACT3 EQ DSNODE4 ;
      END ;
    END ;
/*                                                         */

TLMACRT Coding Example 2
------------------------

In the next example, a PROC FORMAT is used to build a single
account code, TLMACT1.  This simple example shows how SAS
PROC FORMATS can be used to represent a complex mapping
scheme, where a variety of different data set naming patterns
are associated with the appropriate organizational entity.

The TLMACCT member for the account definition for this
example is as follows:

1 8 'DIVISION'

A FORMAT used to define the data set name to account code
mapping could be specified as follows:

PROC FORMAT PRINT ;

 VALUE $ACTLIST
  'TSOGP1*                                      ' = ACCTGRP1
  'TSOGP2*                                      ' = ACCTGRP2
  'TSOGP3*                                      ' = ACCTGRP3
  'TSOGP4*                                      ' = ACCTGRP4
  'TSO.PRINT.DATA                               ' = ACCTPRNT
  'SYS1.VERY.LONG.DATA.SET.NAME                 ' = ACCTPRNT
    ...
    ...
    ...
    ...
   OTHER                                       = ACCTOVRD  ;

Once the $ACTLIST FORMAT is defined, it can be referenced in
the TLMACRT.  The SAS code defined for the user account code
exit would be as follows:

/*---------------------------------------------------------*/
/*                                                         */
/* SAMPLE TLM ACCOUNT CODE DERIVATION EXIT USING FORMATS   */
/*                                                         */
/*  IN THIS EXAMPLE ONLY ONE ACCOUNT CODE, DIVISION,       */
/*  IS DEFINED.                                            */
/*                                                         */
/*  DIVISION IS BUILT USING THE $ACTLIST FORMAT THAT WAS   */
/*  PREVIOUSLY BUILT USING PROC FORMAT.                    */
/*                                                         */
/*  $ACTLIST HAS DEFINED AN ACCOUNT CODE FOR ALL DATA SETS */
/*  BELONGING TO THE TSO GROUPS.  ALL DATA SETS OF THIS    */
/*  TYPE HAVE THE TSO ID AS THE FIRST LEVEL INDEX OF THE   */
/*  DATA SET NAME.   ANY DATA SET THAT DOES NOT CONFORM    */
/*  TO THIS CONVENTION HAS A UNIQUE ENTRY IN THE $ACTLIST  */
/*  TABLE.  ANY DATA SET NOT DEFINED IN THE TABLE IS       */
/*  MAPPED TO THE 'ACCTOVRD' ACCOUNT.                      */
/*                                                         */
/*---------------------------------------------------------*/
/*                                                         */
/* SET DEFAULT VALUES                                      */
/*                                                         */
    TLMACT1 = '*******' ;
/*                                                         */
/*  GET DIVISION                                           */
/*                                                         */
    IF (DSNAME=: 'TSO') AND (INDEX(DSNAME,'.') EQ 7) THEN
      TLMACT1 = PUT(SUBSTR(DSNAME,1,6) || '*',$ACTLIST.);
    ELSE TLMACT1 = PUT(DSNAME,$ACTLIST);
/*                                                         */

Notes:

o Data sets beginning with TSO, whose first level index has a
  length of six, are mapped to their associated account
  groups.

o Data sets that do not conform to this naming convention are
  assigned unique entries in the $ACTLIST FORMAT.

o Data sets that are not covered by the FORMAT definitions
  are mapped to the overhead account.