How can I get totals on a report every time there is a break? Do I need to code a Before-Break Proc?
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.
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: