Previous Topic: 6.2.1.1.2 Adding New Data Elements

Next Topic: 6.2.1.2 Common Data Elements

6.2.1.1.3 Changing Existing Data Element Definitions

Changing the attributes of a data element involves making
modifications to the CA MICS Component Generator (MCG) type
group that includes the data element.

According to the definition in the MCG section of this
document, a type group is made up of a TYPE statement,
followed by one or more NAME statements.  Each NAME statement
defines a data element.  The NAME statement may be preceded
optionally by an ALIAS statement, and may be followed by one
or more EXP statements (if it is a computed data element) and
one or more DEPEND statements (if the data element depends on
other data elements in the file in the same timespans).

The example constructed in the previous section was a TYPE
group that added a data element called NCPPCBSY to the NPANCP
file.  This discussion will refer to that data element for an
example.

   *
   * NPA component generator statements
   *
   GEN GENFILES
   COMP NPA 050 32000 VBS NOACCT NPA Component
   AREA NPA NPA Activity Information Area
   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
   ...


********************************
* TYPE Statement Modifications *
********************************

Changing the TYPE statement of the type group to which the
data element belongs will change the type code, length, or
format specification for the data element.

Changing the length or format can be done by changing the
parameters on the TYPE statement.

TYPE C 4 Z3.2 . . . .

is a valid length/format specification.  See the MCG section
of this document on the TYPE statement.

However, changing the type code may require more thought.  In
the example, having a type code of "C" requires EXP
statements to be included after the data element.  Changing
the type code to other than calculated, such as "A" for
accumulated, would require removal of the EXP statements.

*********************************
* ALIAS Statement Modifications *
*********************************

If the name of the data dictionary member that documents the
data element ever changes, modify or remove the ALIAS
statement.  The data element in the example was documented in
the member USRPCNPA, and the statement was:

ALIAS USRPCNPA

If the documentation for all user data elements were moved to
a single member, such as one called USRMICS, the statement
would be changed to:

ALIAS USRMICS

If the documentation for this data elements was moved to a
member of its own, and named identically to the data element
(NCPPCBSY), then the ALIAS statement can be removed.

********************************
* NAME Statement Modifications *
********************************

The previous two sections of this document showed how to use
the cluster and timespan indicators on the NAME statement to
modify a data element's location on the file and timespans.
Changing the data element tag (short name) actually
constitutes dropping one data element and adding another.
This is because all identification of the data element is
done through the NAME statement tag parameter.

The only element left on the NAME statement to modify is the
data element label.  This parameter on the statement can be
modified in free form, according to the rules of coding the
NAME statement.  If coded in lower case letters with initial
capitals, the label will be translated to upper case by the
MCG where necessary.  For example,

NAME NCPPCBSY 00 0 0 0 0 0 Percent of 3705 Busy
                           --------------------
                                new label


*******************************
* EXP Statement Modifications *
*******************************

EXP statements are only present if the type code from the
TYPE statement is C or XC.  These statements are used in
recalculating the data element's value in summarization.

Let us assume the original calculation for the example were
incomplete, such as:

TYPE C 3 PERCENT. 3 PERCENT. 3 PERCENT.
ALIAS USRPCNPA
NAME NCPPCBSY 00 0 0 0 0 0 3705 Percent Busy
EXP 01 NCPPCBSY = 100 * (NPATMAOT - NCPTMFCT) / NPATMAOT;
DEPEND NCPTMFCT NPATMAOT

This expression could produce a zero-divide condition and SAS
termination if the value of NPATMAOT were ever zero.
Changing the calculation to take this into account is a
matter of rearranging the expression, as

   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

Note that computed data elements of the type code CN and XCN
do not have EXP statements following their name statements.
Rather, calculations for these  data elements are usually
performed as defined by EXP statements that follow two
special NAME statements, @@FIRST or @@LAST.  These NAME
statements do not define data elements that reside on the
file.  Their only purpose is to enter calculations that must
be performed before (or after, respectively) normally-defined
EXP calculations are performed.

Data elements of these types can have their expressions
changed by modifying the EXP statements that calculate the
data elements' value.  These data elements are located in the
@@FIRST or @@LAST group.



**********************************
* DEPEND Statement Modifications *
**********************************

Depend statements define the relationships between the data
element in question and other data elements.  Reasons for
modifying DEPEND statements are rare, but the DEPEND
statement may contain any combination of one or more data
element names.  Each data element named in a DEPEND statement
must exist on the file in all the same timespans as the data
element in question.

    Our original example included

   DEPEND NCPTMFCT NPATMAOT

to insure that the NCP file could not be generated if
NCPPCBSY was in a timespan without either NCPTMFCT or
NPATMAOT.  Either case would define an invalid construction
of the summarization for NCPPCBSY.  If some other data
element were identified as being required for the calculation
of the data element, it would be added to the DEPEND list for
that element.

For example, if you want NCPPCIDL, the percent of 3705 idle
time, to be on the file in every timespan as NCPPCBSY, code:

   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 NCPPCIDL


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

To change the data element's description in the above manner,
perform the following:

    - Modify the MCG control statements explained above for
      each data element to be modified.

    - Run the component generation for the component 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 file in the
      desired timespan(s).

A Change to the definition of a data element will not
necessarily be reflected accurately in timespans greater
than DAYS.  Accumulating data to the WEEKS, MONTHS, and YEARS
timespans takes some time to complete.  Also, the
accumulation of to-date data in these timespans may result
in combining unlike data.  Changing data elements from
accumulated to maximum or minimum, for example, will always
produce spurious results in these timespans.  This problem
is resolved by itself only after the modification has been in
effect long enough that unlike data is not being combined.

It is therefore necessary to examine the need for
retrofitting existing data in such situations.  If the need
for a retrofit exists, see the section of this document on
database maintenance techniques.