After you have defined VCAACCT for the number of account
codes to be carried in the VCA files, your next step is to
code the VCA Account Code Derivation Exit (VCAACRT) in
sharedprefix.MICS.PARMS to create the SAS routine that will
derive the account code data elements during the DAY090 step.
For example, if you have defined four account codes in
VCAACCT, then the VCAACRT exit must contain SAS code to
assign the data elements VCAACT1, VCAACT2, VCAACT3, and
VCAACT4 for each detail record processed.
*----------------------------------------------------*
* IMPORTANT: If you intend to support the HSM *
* component of the CA MICS Space Analyzer, *
* please keep in mind that the objective is the *
* creation of a single routine for your site that *
* is included in DAY090 processing for VCA and in *
* DAY095 processing for HSM. If a coding example *
* shows VCAACRT techniques, it will be important *
* to keep in mind that the VCAACRT code will be *
* included in HSM too and therefore the code *
* should confine itself to common elements. *
*----------------------------------------------------*
You are responsible for testing the accuracy of the exit
routine; some sample exit coding techniques are provided here
to give you ideas for adapting your own routine. A worksheet
for coding the VCAACRT exit is shown in Figure 7-2.
To determine the account code value, most sites use the data
element DSNAME (data set name), which is kept in the DETAIL
timespan.
For convenience, several "work" variables are assigned for
use by your exit. The following example shows the SAS
statements provided by VCA and HSM prior to calling the
VCAACRT or HSMACRT exit respectively:
DSNODE1 = SCAN(DSNAME,1,' .'); /* ISOLATE */
DSNODE2 = SCAN(DSNAME,2,' .'); /* 1ST FIVE */
DSNODE3 = SCAN(DSNAME,3,' .'); /* NODES OF */
DSNODE4 = SCAN(DSNAME,4,' .'); /* DATA SET */
DSNODE5 = SCAN(DSNAME,5,' .'); /* NAME */
/* LAST NODE*/
DSNODEL = LEFT(REVERSE(SCAN(REVERSE(DSNAME),1,' .')));
SKIP_REC = 0; /* ALLOW VCAACRT TO SET SKIP_REC */
FILEID = 'VCADAA'; /* ALLOW VCAACRT TO TEST FILEID */
EXIT='VCAACRT';
%INCLUDE SHRPARMS(VCAACRT);
EXIT=BLANKS;
/*-------------------------------------------------------*/
Notes:
1. DSNODE1 through DSNODE5 are not permanent variables in
either VCAGENIN or HSMGENIN. They are created simply
for your coding convenience in accessing the qualifiers
of the DSNAME of the current observation.
2. DSNODEL is the last node of the DSNAME.
3. SKIP_REC can be set to 1 by your exit code to DELETE
the current observation. This function is also available
in the file exit associated with each file (for example,
USRSDAA could set SKIP_REC too).
4. FILEID is set by calling module to the following values to
give your exit code the opportunity to know for which file
it has been called to assign account codes:
FILEID = 'VCADAA'; /* When called for VCADAA file */
FILEID = 'VCA_VS'; /* When called for VCA_VS file */
FILEID = 'HSMMIG'; /* When called for HSMMIG file */
FILEID = 'HSBBAC'; /* When called for HSBBAC file */
Careful testing of this temporary variable by your
VCAACRT routine allows your code to access file-specific
variables if needed (REMEMBER - VCAACRT is %INCLUDEd by
HSMACRT !).
The VCAACRT 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.
VCAACRT Coding Example 1
In the following example, assume that you have defined three
account code levels in the VCAACCT PARMS member and that they
are derived as follows:
VCAACT1 - is the first three characters of the high-level
node of the data set name.
VCAACT2 - is the second three characters of the high-
level node of the data set name.
VCAACT3 - is the second node of the data set name if it
is three characters in length.
The standard data set naming convention is that the high-
level node of the data set name is either three or six
characters in length and the second-level node is three
characters in length. An overhead category is defined for
each account code level and the following special case is
handled for data sets whose first account code is 'SYS'. If
the high-level node of such a data set is not exactly three
characters in length, the second- and third-level account
codes are set to the overhead category.
The VCAACCT member for the account definition would be:
1 3 'DIVISION'
2 3 'REGION'
3 3 'PROJECT'
The SAS code defined for the user account code exit would be:
/*---------------------------------------------------------*/
/* */
/* SAMPLE VCA ACCOUNT CODE DERIVATION EXIT */
/* */
/* DIVISION IS BUILT FROM POSITIONS 1-3 OF NODE ONE OF */
/* THE DATA SET NAME. */
/* */
/* PROJECT IS BUILT FROM POSITIONS 4-6 OF NODE ONE OF */
/* THE DATA SET NAME. */
/* */
/* USER IS BUILT FROM POSITIONS 1-3 OF NODE TWO OF THE */
/* DATA SET NAME. */
/* */
/* */
/* DSNODE1-DSNODE5 ARE VARIABLES THAT CONTAIN THE */
/* FIRST FIVE NODES OF THE DATA SET NAME */
/* RESPECTIVELY. */
/* */
/*---------------------------------------------------------*/
IF INDEX(DSNODE1,' ') LE 3 THEN VCAACT1 = '***';
ELSE VCAACT1 = SUBSTR(DSNODE1,1,3);
IF INDEX(DSNODE1,' ') LT 6 THEN VCAACT2 = '***';
ELSE VCAACT2 = SUBSTR(DSNODE1,4,3);
IF INDEX(DSNODE2,' ') NE 3 THEN VCAACT3 = '***';
ELSE VCAACT3 = DSNODE2;
IF VCAACT1 EQ 'SYS' AND DSNODE1 NE 'SYS' THEN DO;
VCAACT2 = '***';
VCAACT3 = '***';
END;
ACCTRTEX: /* a label that the code could GOTO */
VCAACRT Coding Example 2
In the next example, a PROC FORMAT is used to build a single
account code, VCAACT1.
The VCAACCT member for the account definition for this
example would be:
1 8 'DIVISION'
The FORMAT used to define the data set name to account code
mapping would be specified as follows:
PROC FORMAT PRINT ;
VALUE $ACTLIST
'TSOGP1* ' = ACCTGRP1
'TSOGP2* ' = ACCTGRP2
'TSOGP3* ' = ACCTGRP3
'TSOGP4* ' = ACCTGRP4
'TSO.PRINT.DATA ' = ACCTPRNT
'SYS1.VERY.LONG.DATASET.NAME ' = ACCTPRNT
.
.
.
OTHER = ACCTOVRD ;
For those of you new to SAS, this SAS PROC FORMAT builds a
table that when compiled forms a load-module. References to
the value, $ACTLIST, are resolved with a binary search
technique by SAS.
The above format could then be used in the VCAACRT exit to
map data set names to account codes as follows. Data sets
beginning with TSO whose first level index has a length of
six are mapped to their associated account groups. If a data
set name does not conform to this naming convention, then it
must have a unique entry in the table. Otherwise, it is
mapped to the overhead account.
The SAS code defined for the user account code exit would be
as follows:
/*---------------------------------------------------------*/
/* */
/* SAMPLE VCA ACCOUNT CODE DERIVATION EXIT USING FORMATS */
/* */
/* IN THIS EXAMPLE ONLY ONE ACCOUNT CODE, DIVISION, */
/* IS DEFINED. */
/* */
/* DIVISION IS BUILT USING THE $ACTLIST FORMAT WHICH 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. */
/* */
/*---------------------------------------------------------*/
IF (DSNAME=: 'TSO') AND (INDEX(DSNAME,'.') EQ 7) THEN
VCAACT1 = PUT(SUBSTR(DSNAME,1,6) || '*',$ACTLIST.);
ELSE VCAACT1 = PUT(DSNAME,$ACTLIST);
+--------------------------------------------------------------------------+ | INSTALLATION PREPARATION WORKSHEET: VCA Account Code Routine Definition | | | | PARMS Library Member is VCAACRT | | Reference: Section 7.2.2, CA MICS Space Analyzer Guide | +--------------------------------------------------------------------------+ | | | * VALIDATE FOR VALID ACCOUNT CODES, WHERE POSSIBLE ; | | IF account data is not valid GOTO ACCTOVHD ; | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | * BUILD ACCOUNT CODE FIELDS | | VCAACT1=field source 1 ; | | VCAACTn=field source n ; | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | GOTO ACCTRTEX ; | | * LINKED ROUTINE TO BUILD INSTALLATION OVERHEAD ACCOUNT CODES ; | | ACCTOVHD: | | VCAACT1='overhead category' ; | | VCAACTn='overhead category' ; | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | | | ________________________________________________________________________ | | ACCTRTEX: | | | +--------------------------------------------------------------------------+ | ....5...10...15...20...25...30...35...40...45...50...55...60...65...70.. | +--------------------------------------------------------------------------+
Figure 7-2. VCA Account Code Derivation Exit Worksheet
|
Copyright © 2014 CA.
All rights reserved.
|
|