6. Database Tailoring and Retrofitting Techniques › 6.2 Tailoring the Database › 6.2.1 Tailoring Data Elements › 6.2.1.2 Common Data Elements › 6.2.1.2.2 Adding New Common Data Elements
6.2.1.2.2 Adding New Common Data Elements
Adding a common data element involves adding a CA MICS
Component Generator (MCG) TYPE group that includes the common
data element. Then add the common element to the files in
which you want it reported.
If the new common data element is local to any single
component, add the TYPE group to the component's cccGENIN
member in sharedprefix.MICS.GENLIB. If the new common data
element is useful for more than one component, add the TYPE
group to the $DEGENIN member in sharedprefix.MICS.GENLIB.
As discussed in chapter 4, a common data element TYPE
group is made up of the following statements:
o a TYPE statement, mandatory
o an ALIAS statement, optional
o an ALTNAME statement, optional
o a NAME statement, mandatory
The example file definition contains the component
generator definition statements:
...
COMP NPA 050 32000 VBS NOACCT NPA Component
TYPE XR 3 . 3 . 3 .
NAME NPANRRLS Receiving Line Speed (line/link)
TYPE XR 3 . 3 . 3 .
NAME NPANRSLS Sending Line Speed (line/link)
TYPE XA 5 TIME11.2 6 TIME15.2 6 TIME15.2
NAME NPATMAOT Actual Observation Time
...
AREA NPA NPA Activity Information Area
...
Adding a common data element can be done by adding the
TYPE group for the data element into the NPAGENIN member.
For example, assume a data element called PHASE were to be
added to the NPA component. PHASE is intended to contain the
character strings "FULL", "1Q ", "3Q ", or "NEW ", so it
should be defined as a character data element of length four.
Define the data element in NPAGENIN by keying in the
following prior to the first AREA statement:
...
TYPE XR $4. . $4. . $4. .
NAME PHASE Phase of Processing Period
...
Then add the new common element to each file in which you
want the element reported by adding a NAME statement like the
following after each FILE statement:
NAME PHASE 99 0 0 0 0 0 .
Since this is a retained data element, we also need to
add statements that describe the calculation necessary to put
an initial value in PHASE. The value could be set by any
means. Assume that the site has a user-written routine that
returns a character value for the "phase" and the argument
supplied to the routine is the time stamp of the end of the
measurement interval.
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:
MACRO _USRSNCP %
which should be modified to:
MACRO _USRSNCP
PHASE = UPHASE(ENDTS);
%
This code will be executed immediately before the format
routine writes a DETAIL observation of the NPANCP file, and
the data element value will be set when the OUTPUT occurs.
Such logic would have to be executed to set a value for
PHASE before the format routine OUTPUT for each file of each
component in which the data element is to be carried.
****************************
* Making the Modifications *
****************************
To add a data element to one or more timespans of one or
more files within one or more components, if the data element
is not a sequence data element in the file, perform the
following:
- Code the MCG type group statements for the data element
to be added to either $DEGENIN or cccGENIN.
- Add the element to the files in which you want it
reported.
- 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 components in
question.
- The next daily update for any database unit in which
the component has been installed will reflect the
change, and add the data element to the files in the
desired timespan(s).
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.