TOTAL Connective Processing

When the English processor sees a TOTAL connective in a sentence, it prepares a counter to accumulate the specified attribute. It marks this counter with the AMC found in attribute 2 of the data definition item. The processor positions the counters logically left to right as it finds the totalled attributes in the sentence. This left-to-right positioning is important because more than one counter can be marked with the same AMC.

Detail Line Processing

In processing an attribute specified with the TOTAL connective, the processor applies all pre-processor codes and adds the resulting intermediate value to the counter for that attribute. If the intermediate value is to be displayed on the detail line, the processor applies the conversions to the value for display. If a function code in the output conversion has attribute references, the processor resolves the references with respect to the item being processed.

Total Line Processing

When the processor prepares to output a total, it processes the output conversions (attribute 7) in the data definition item. However, it processes format and function codes differently.

When handling a format code, the processor applies the format code to the counter accumulated for the specified attribute, so that what is displayed is derived from the total for that attribute.

When handling a function code (A, AE, F, FE or FS), the processor resolves an attribute reference by using the AMC attached to each total counter, not the attribute specified in the sentence. The processor looks at the counters from left to right and uses the contents of the first counter it finds with the indicated AMC. If it does not find a counter with the proper AMC, the processor uses zero as the value to be processed by the function.

Format codes used within a function follow the rules of the function.

Only Totalled Attributes Have Counters

The processor assigns counters only to attributes preceded by the TOTAL connective. The AMC of an untotalled attribute in an output specification is not assigned a counter. The manner in which function codes work is useful in calculating averages.

For example, you could use the ND operand (number of detail lines) to obtain the average of a sum. Since the total displayed at the bottom of a column may bear no relationship to the detail values in the same column, you may want to suppress displaying the detail values in that column by assigning the attribute a dummy AMC (for example, 99, assuming that the items do not have 99 attributes). If the totals of several columns are to be referenced by functions in the conversion of a totalled column, a different dummy AMC should be assigned to each data definition item so that each can be referenced uniquely. If the total of a column is of interest only for use by a function in another column, put a backslash in attribute 3 and a zero in attribute 10 of the data definition item to suppress that column on the display.

Go to top button