TALLY (T)
The TALLY function lets you combine groups of selection parameters with ACCUM parameters to provide audit-type totals for entire files. To place the titles and totals produced by a TALLY function on a separate output dataset, define the SYSTOTAL dataset in the JCL job stream. If SYSTOTAL is undefined, the TALLY output appears on the SYSPRINT dataset along with the other program messages. The TALLY function always processes all parameter groups for each input record, as if the ALL modifier had been specified. Thus, TALLYALL is not valid.
Example:
IF=(6,EQ,C’08’),IF=(10,EQ,C’90’),ACCUM=(16,’AUGUST 1990’)
This example locates any record that has a value of 90 in locations 10 and 11, and accumulates the packed field that begins in location 16. If locations 6 and 7 contain a value of 08, File-AID takes a second accumulation. After execution, the resulting accumulation totals are labeled TOTALS 1990 and AUGUST 1990 when printed on the SYSTOTAL dataset.
Accumulation Comment Cards
Comment cards can be used to generate headings for accumulations printed on the SYSTOTAL output dataset. Comment cards are optional and can be entered at any time. Because they are printed in the order in which they are coded, place the comment cards immediately before the control cards that process the accumulation.
Code accumulation comment cards with an asterisk (*) in location 1.
Example:
$$DD01 TALLY IF=(12,EQ,C’06’),ACCUM=(8,3,C,’SUBTOTAL’)
File-AID prints the accumulation comment cards first. It then produces a two-line data set identification message after the comment and before the accumulation.
The first line is the statement:
The second line is the input dataset name and volume serial number.
The next line contains the accumulation output totals. See SYSTOTAL Output for examples of accumulation output.