Often, when accessing data, a simple count of the fields that contain the same values within a table is required as part of the data access. Using a calculation table, the values can be accessed via a source table and counted. The values are dynamically updated for you each time a change is made to the source table. You must have DEF_VIEW access to the source table to define a calculation view of it.
After entering the initial Table Definer screen described in Accessing the Table Definer, you must change the table type field to CLC. When you press Enter, a screen similar to the following appears.
In the Source field, enter the name of the table that is your source of data. The source table must already exist and it must be a TDS table. When you provide the source name and press Enter, the screen is populated with values from the source table.
The field values are provided for you when you press Enter after specifying a source table name. In addition, a new primary key field named
KEY and a new non-key field named
COUNT are added and defined, and two new fields called
Src and
Source Name are added.
Except for the KEY and
COUNT fields, delete the fields that are not to be counted. You can use the
D line command to delete the fields. The names for the
KEY and
COUNT fields can be changed but you must not change the default attributes for these fields.