4. CUSTOMIZATION › 4.1 Defining Cost Centers › 4.1.3 Assigning Cost Center Values
4.1.3 Assigning Cost Center Values
Once you have defined the cost center fields to be kept in
the CA MICS Accounting and Chargeback Option files, you must
code an exit in SAS that will assign values to these fields.
You store this exit routine in the COSTRTE member of the
sharedprefix.MICS.PARMS library. Use the COSTRTE member to
assign values when the CA MICS database records and the
external file records are being processed. To code the
routine, select the Cost Routine option on the Cost Center
Definition Menu (MWF;4;2;3;1;2).
The appropriate CA MICS program uses COSTRTE for each work
unit processed. The exit routine must assign values to all
cost center levels defined in
sharedprefix.MICS.PARMS(COSTCTR), even if the values are
blank. This routine MUST be correct or the wrong user groups
will accrue the charges. Because of this, we recommend that
you test the routine.
There is a sample routine delivered with CA MICS Accounting
and Chargeback Option in member COSTRTE in
sharedprefix.MICS.HOLD.PARMS.
Your cost center derivation exit has available to it each of
the account code fields of the products used in charging (for
example, ACCTNO1-n, IMSACT1-n, and CICACT1-n, for the CA MICS
Batch and Operations Analyzer (SMF), IMS Analyzer, and CICS
Analyzer, respectively), as well as the fields that are
documented in the CA MICS Data Dictionary for the products.
IMPORTANT: You cannot assign any characters less than
hexadecimal '40', the representation of blank, to
your cost centers. If any characters less than
hexadecimal '40' are assigned, invoice level and
billing status may not be assigned correctly when
the Financial Recap File is created at the end of
accounting period.
CODING CONSIDERATIONS
In coding the cost routine (COSTRTE), you must build the cost
center fields for all CA MICS data that you will use in CA
MICS Accounting and Chargeback Option. You must have an IF
statement testing the ROUTINE variable for each product for
which you are charging. The value of ROUTINE is DYcccFMT,
where ccc is the product identifier, for CA MICS Analyzers
and Field Developed Applications. For external files, the
value of ROUTINE is fffINPUT, where fff is the last three
characters of the external file name. Each section of code
must specify the cost center values appropriate for the
product. This is important because different data is
available for each product being processed.
If you have the CA MICS Analyzer for MeasureWare OS Agents
installed, use an IF WRKNAME= statement in the section for
ROUTINE DYAUMFMT to test whether the Application Performance
File (AUMAPP) or UNIX Process Activity File (AUMKPS) is being
processed. The elements available to populate the cost
centers differ depending upon which file is being processed.
In particular, the AUMAPU element is only available from the
AUMAPP file and the AUMACTn elements are only available from
the AUMKPS file. Refer to the sample COSTRTE member for an
example.
The routine must be a valid SAS routine with no embedded DATA
or PROC statements. Do not use SAS labels in the COSTRTE,
because the CA MICS code includes this routine multiple
times. Any label would cause a 'duplicate SAS label' error.
In addition, do not use a RETURN or DELETE statement in the
COSTRTE. They cause records to be dropped or deleted from
all files.
For charging from CA MICS files, your Cost Center Derivation
exit can use any of the data elements contained in the
CA MICS database files. In addition, the exit can make use of
some data elements (such as ACTFLD1-5 for SMF) that are not
written to the database, but are temporarily available at the
time of the exit. If the COSTCTR1-n values are derived
directly from the ACTFLD1-5 fields in the DYSMFFMT routine,
you must check the I_AUDIT or the J_AUDIT indicator to
determine whether either of these records is present before
valid ACTFLD1-5 values are available.
Many installations derive the COSTCTR1 values from a SAS PROC
FORMAT built in a previous job. You can store SAS PROC
FORMATs in your sharedprefix.MICS.MCOLIB library on a
periodic basis to reflect any new elements that may be
chargeable. The binary search used by SAS in these tables
makes this coding technique very efficient. The instruction
in the COSTRTE to search the previously built SAS PROC FORMAT
should be in the following form:
COSTCTR1 = PUT(JOB,$USRFMT.);
The $USRFMT FORMAT contains each possible JOB with its
corresponding COSTCTR1 value. A value of OTHER is placed in
the PROC FORMAT as a default value in case there is not a
match. If you use a PROC FORMAT, then you must code a SAS
RETAIN statement at the start of the COSTRTE to initialize
the search elements (for example, JOB, USERID, RSCACCT);
otherwise, a SAS error will occur. If you code a RETAIN
statement for one or more COSTCTR variables, you must ensure
that these variables are assigned values for each record to
prevent the values from propagating from previous records.
Review the PIOM or the CA MICS product guides to compare
other coding techniques for the various account routines in
relationship to the COSTRTE coding.
The following codes the COSTRTE member for the cost center
structure example shown in Section 4.1.1.2:
/* SAS coding example of the COSTRTE member */
IF ROUTINE = 'DYSMFFMT' THEN DO;
COSTCTR1 = SUBSTR(JOB,1,3);
COSTCTR2 = SUBSTR(JOB,4,3);
COSTCTR3 = JOBPRGNM;
END:
Considerations for Complex-Level External Files
-----------------------------------------------
For complex-level external files, you can code a statement in
your external file input routine to invoke the Cost Center
Derivation Exit. The statement is:
%INCLUDE SHRPARMS(COSTRTE);
Coding this statement is optional and is not necessary if you
have assignment statements for the COSTCTRs as part of your
complex-level external file input routine.
For CA MICS-supplied external file interfaces, such as NSM
Asset Management Option (AMO), NT resource accounting data
(NTA), and CA IAM, the COSTRTE routine is called as each
input record is processed, and the cost center values are
derived based on the code that you supply in COSTRTE.
For the AMO interface, you can use any data fields that are
read from the input record in coding the COSTRTE routine.
The default set of variables that can be used to derive
cost center values include:
DOMAIN - The domain in which the asset is defined.
U_NAME - The unit name of the asset. In AMO, a unit
identifies a single computer.
U_ID - The unit id corresponding to the unit name.
AREA - The AMO area. In AMO, an area identifies a
number of units that can be managed together.
For the NTA interface, you can use any data fields that are
read from the input record in coding the COSTRTE routine.
The default set of variables that can be used to derive
cost center values include:
MACHINE - The name of the NT machine
USERID - User ID. This is the login name for which
the data has been collected.
Optionally, you can create a SAS format for each of your
complex-level external files by using the Cost Center Look Up
Table panel. The format's name is $ACTUfff, where fff is the
last three characters of the external file name. This
facility allows you to translate the input fields into
meaningful account code values. You can use the format in
your COSTRTE routine in place of numerous IF statements. See
Section 4.4.5, Entering Cost Center Look Up Table Values, to
determine how to create the SAS format.
The following provides a sample COSTRTE routine for NT
resource accounting data (NTA):
/* SAS coding example of the COSTRTE member */
IF ROUTINE = 'NTAINPUT' THEN DO;
COSTCTR1 = SUBSTR(MACHINE,1,4);
COSTCTR2 = USERID;
END:
If you use the Cost Center Table Look Up feature to build a
SAS format for translation, you can use the format in your
routine as follows:
IF ROUTINE = 'NTAINPUT' THEN DO;
RETAIN MACHINE USERID;
COSTCTR1 = PUT(MACHINE,$ACTUNTA.);
IF COSTCTR1='NONE' THEN COSTCTR1= MACHINE;
COSTCTR2 = PUT(USERID,$ACTUNTA.);
IF COSTCTR2='NONE' THEN COSTCTR2= USERID;
END;
The following sections describe how to complete the
derivation:
1 - Cost Center Derivation Worksheet
2 - Cost Center Derivation Example