How can I get totals on a report every time there is a break? Do I need a Before-Break Proc coded?
search cancel

How can I get totals on a report every time there is a break? Do I need a Before-Break Proc coded?

book

Article ID: 12755

calendar_today

Updated On:

Products

PanAudit Plus Easytrieve Report Generator PAN/SQL

Issue/Introduction



How can I get totals on a report every time there is a break?  Do I need to code a Before-Break Proc?

Environment

Release: EDBMSU00200-11.6-Easytrieve-Report Generator-Option for DB2-MSU
Component:

Resolution

Use TALLY on the LINE statement.

Also, please ensure that TALLYSIZE parameter on the REPORT statement is specified with a large enough number to allow the final line totals to print the totals correctly as well.  

No Before-Break Proc needs to be coded for this functionality to get a count of totals when a break occurs.

Additional Information

https://docops.ca.com/ca-easytrieve/11-6/en/programming/report-processing/control-reports#CONTROLReports-TALLY has the following information:

TALLY is a system-defined field for control reports. TALLY contains the number of detail records that comprise a control break. You can use TALLY on a LINE statement or you can use it in calculations within report procedures. TALLY is commonly used to determine averages for a control break.

TALLY is a 10-byte packed decimal field with zero decimal places. This definition is used for calculations contained within report procedures. REPORT TALLYSIZE defines the number of digits that are printed for TALLY. A TALLY accumulator is created for each control break level.

https://docops.ca.com/ca-easytrieve/11-6/en/language-reference/statements-n-r/report-statement has further information on the TALLYSIZE parameter on the REPORT statement:

  • Use TALLYSIZE to set the print size for the field TALLY. Valid values for tally-print-size are 1 to 18. The number of digits used for TALLY on a summary line is the sum of the values of TALLYSIZE and SUMSPACE.