Previous Topic: 6.2.1.1.1 Deleting Data Elements

Next Topic: 6.2.1.1.3 Changing Existing Data Element Definitions

6.2.1.1.2 Adding New Data Elements

There are two facilities available to add a data element to a
file:

    - If a data element belongs to a selectable cluster of
      data elements, the entire selectable cluster can be
      activated in all timespans of all files within a
      component by modifying the MCG OPTION statement.

    - New data elements can be added to individual files
      within a component by coding CA MICS Component
      Generator (MCG) TYPE group statements to describe the
      data elements for each file in which they are to
      appear.

**********************************
* OPTION Statement Modifications *
**********************************


The original form of the NPA Component's definition shown
earlier began as follows:

   *
   * NPA Component generator statements
   *
   GEN GENFILES
   COMP NPA 050 32000 VBS NOACCT NPA Component
   TYPE XR  3 . 3 . 3 .
   NAME NPANRRLS  Receiving Line Speed (line/link)
   NAME NPANRSLS  Sending Line Speed (line/link)
   TYPE XA  5 TIME11.2  6 TIME15.2  6 TIME15.2
   NAME NPATMAOT  Actual Observation Time
   TYPE XR  4 TIME8.  4 TIME8.  4 TIME8.
   NAME NPATSEIS  Expected Interval Time
   NAME NPATSFRU  Forward RU Send Time
   NAME NPATSLOG  Time Record Logged To SMF
   AREA NPA NPA Activity Information Area
   FILE NCP 00 1 Y Y Y Y N N Y Y NCP Activity File
   TYPE R 3 . 3 . 3 .
   NAME NCPNRFBQ  00  0 0 0 0 0 Free Buffer Queue Length
   NAME NCPNRHQL  00  0 0 0 0 0 NCP Channel Hold Queue Length
   NAME NCPNRIQL  00  0 0 0 0 0 NCP Channel Intrmd Queue Len.
   NAME NCPNRSFB  00  0 0 0 0 0 Free Buffer Count At Slowdown
   TYPE A 5 TIME11.2 6 TIME15.2 6 TIME15.2
   NAME NCPTMFCT  00  0 0 0 0 0 Free Cycle Time
   NAME NCPTMTIS  00  0 0 0 0 0 Time In Slowdown
   ...

This component has no selectable data element clusters, and
therefore the standard generator statements do not include an
OPTION statement.

Assume that there is a valid NPA Component cluster ID
called NET1, and its cluster number is 47.  The OPTION
statement might be included in the NPA definition member, and
data elements belonging to the cluster would have a cluster
code of 47 coded in their NAME statements, as follows:

   *
   * NPA Component generator statements
   *
   GEN GENFILES
-->OPTION NONET1
   COMP NPA 050 32000 VBS NOACCT NPA Component
   TYPE XR  3 . 3 . 3 .
   NAME NPANRRLS  Receiving Line Speed (line/link)
   NAME NPANRSLS  Sending Line Speed (line/link)
   TYPE XA  5 TIME11.2  6 TIME15.2  6 TIME15.2
   NAME NPATMAOT  Actual Observation Time
   TYPE XR  4 TIME8.  4 TIME8.  4 TIME8.
   NAME NPATSEIS  Expected Interval Time
   NAME NPATSFRU  Forward RU Send Time
   NAME NPATSLOG  Time Record Logged To SMF
   AREA NPA NPA Activity Information Area
   FILE NCP 00 1 Y Y Y Y N N Y Y NCP Activity File
   TYPE R 3 . 3 . 3 .
   NAME NCPNRFBQ  00  0 0 0 0 0 Free Buffer Queue Length
-->NAME NCPNRHQL  47  0 0 0 0 0 NCP Channel Hold Queue Length
-->NAME NCPNRIQL  47  0 0 0 0 0 NCP Channel Intrmd Queue Len.
   NAME NCPNRSFB  00  0 0 0 0 0 Free Buffer Count At Slowdown
   ...

To activate the entire cluster, change the cluster keyword
NONET1 to NET1.  All data elements that belong to the cluster
(including NCPNRHQL and NCPNRIQL) would be added to all
timespans of all files for which they are defined in the NPA
Component:

   *
   * NPA Component generator statements
   *
   GEN GENFILES
-->OPTION NET1
   COMP NPA 050 32000 VBS NOACCT NPA Component
   ...

See the individual product guides for a list of cluster names
used in a specific product's cccGENIN member.

**********************************
* TYPE Statement Group Additions *
**********************************


The example file definition contains the component
generator definition statements:

    ...
    TYPE A 5 TIME11.2 6 TIME15.2 6 TIME15.2
    NAME NCPTMFCT  00  0 0 0 0 0 Free Cycle Time

Assume that your NPA Component does not have a data
element for percentage of time the 3705 was busy in the
measurement interval.  Such a data element could be
calculated from the duration of the measurement interval and
the free cycle time measured in the interval.

Adding this data element to the file can be done by adding a
TYPE group of MCG statements to the file's existing
statements in cccGENIN.  The TYPE statement itself can be
configured from scratch or can be patterned after a TYPE
statement for a similar data element in this or another
cccGENIN member.  For the percent data element, use the
following:

TYPE C 3 MAPCT.   3 MAPCT.   3 MAPCT.
     - ---------- ---------- ----------
     |     |          |          |
     |     |          |          +- MONTHS/YEARS length/fmt
     |     |          +------------ DAYS/WEEKS length/format
     |     +----------------------- DETAIL length/format
     +----------------------------- type: computed

    Code the NAME statement as follows:

TYPE C 3 MAPCT.   3 MAPCT.   3 MAPCT.
NAME NCPPCBSY 00 0 0 0 0 0 3705 Percent Busy
     -------- -- --------- -----------------
        |      |     |            |
        |      |     |            +- data element label
        |      |     +-------------- active in all timespans
        |      +-------------------- no associated cluster
        +--------------------------- name of data element;
                                     begins with file name
                                     (NCP)

Assume that such user-added data elements are to be
documented in the CA MICS Data Dictionary. In fact, all such
user-added NPA percentage data elements can be documented in
the same member of the Data Dictionary.  Such a Data
Dictionary member may be called USRPCNPA.  To gain access to
that member through the Document Access online browse
function, add an ALIAS statement to the type group,

TYPE C 3 MAPCT.   3 MAPCT.   3 MAPCT.
ALIAS USRPCNPA
NAME NCPPCBSY 00 0 0 0 0 0 3705 Percent Busy

(This feature is used in CA MICS for closely-related data
elements, such as a set of counters.  Thus a set of counter
data elements COUNT01-COUNT08 could all be described in a
Data Dictionary entry called COUNTXX.)

Since this is a calculated data element, we also need to
add statements that describe the calculation necessary to put
a value in NCPPCBSY.  The value should be

                      busy time
    percent busy = -----------------
                   interval duration

where busy time is the interval duration minus the free time.
Thus, the type group has the expression added:

TYPE C 3 MAPCT.   3 MAPCT.   3 MAPCT.
ALIAS USRPCNPA
NAME NCPPCBSY 00 0 0 0 0 0 3705 Percent Busy
EXP 01 IF NPATMAOT GT 0 THEN
EXP 02  NCPPCBSY = 100 * (NPATMAOT - NCPTMFCT) / NPATMAOT;
EXP 03 ELSE NCPPCBSY = 0;

Also, the calculation of this data element's value depends on
other data elements existing in the timespans in which
NCPPCBSY is to be active.  So, a DEPEND statement has to be
added:

TYPE C 3 MAPCT.   3 MAPCT.   3 MAPCT.
ALIAS USRPCNPA
NAME NCPPCBSY 00 0 0 0 0 0 3705 Percent Busy
EXP 01 IF NPATMAOT GT 0 THEN
EXP 02  NCPPCBSY = 100 * (NPATMAOT - NCPTMFCT) / NPATMAOT;
EXP 03 ELSE NCPPCBSY = 0;
DEPEND NCPTMFCT NPATMAOT

The definition of the data element in the MCG Component
definition statements is complete.  These statements are to
be added at a TYPE group break, such as:

   ...
   FILE NCP 00 1 Y Y Y Y N N Y Y NCP Activity File
-->TYPE C 3 PERCENT. 3 PERCENT. 3 PERCENT.
-->ALIAS USRPCNPA
-->NAME NCPPCBSY 00 0 0 0 0 0 3705 Percent Busy
-->EXP 01 IF NPATMAOT GT 0 THEN
-->EXP 02  NCPPCBSY = 100 * (NPATMAOT - NCPTMFCT) / NPATMAOT;
-->EXP 03 ELSE NCPPCBSY = 0;
-->DEPEND NCPTMFCT NPATMAOT
   TYPE R 3 . 3 . 3 .
   NAME NCPNRFBQ  00  0 0 0 0 0 Free Buffer Queue Length
   NAME NCPNRHQL  00  0 0 0 0 0 NCP Channel Hold Queue Length
   ...

However, the data element is specified to exist in the DETAIL
timespan of the file.  The EXP statements generate the code
to recalculate the data element at each level of
summarization, but no calculation is made at the DETAIL
level, because the MCG does not modify the component's daily
format routine.

To store a value in the data element in the DETAIL
timespan, modify logic in the component's daily format
routine using standard CA MICS file exits. (See the User Exit
Facilities section in chapter 4 for more information.)

For this NPA example, the file exit for the NPANCP File
is  _USRSNCP, in sharedprefix.MICS.SOURCE(#NPAEXIT).  The
calculation must be added to the stub exit macro that
currently exists.  The current macro is coded as

    MACRO _USRSNCP   %

and should be modified to

    MACRO _USRSNCP
      IF NPATMAOT GT 0 THEN
       NCPPCBSY = 100 * (NPATMAOT - NCPTMFCT) / NPATMAOT;
      ELSE NCPPCBSY = 0;
    %

This code is executed immediately before the format
routine writes a DETAIL observation of the NPANCP File and
the data element value is set when the OUTPUT occurs.

****************************
* Making the Modifications *
****************************

To add a data element to one or more timespans if the
data element is not a sequence data element in the file,
perform the following:

   - Modify the option selection codes on the OPTION
     statement, if necessary.

   - Code the MCG TYPE group statements for the data element
     to be added, if necessary.

   - Add initial calculations for the data element's DETAIL
     timespan value to the standard file exit in the
     component's standard exit member on the CA MICS source
     library.

   - Run the component generation for the component in
     question.

   - Add the data element to the file in the desired
     timespan(s) since the next daily update for any
     database unit in which the component has been installed
     reflects the change.

To add a data element to one or more timespans if the data
element IS a sequence data element in the file, see the
sections in this chapter on modifying the sequence of a file.
Modify the sequence, and follow the instructions above to add
the data element.