Reports Generated using BeforeDoPrint and AfterDoPrint events

If you defined BeforeDoPrint and AfterDoPrint events, as described in BeforeDoPrint and AfterDoPrint Event Paragraphs, the program's .cbl source file will contain the code to populate the data, and will look something like this:

      REPORT-COMPOSER SECTION. 
      *{Bench}Myreport-masterprintpara 
       Acu-RPT-Myreport-MASTER-PRINT-LOOP. 
        
      *Before do print paragraph 
              PERFORM Myreport-BeforeDoPrint 
           PERFORM UNTIL Myreport-DOPRINTRTN-LOOP = 0 
               PERFORM ACU-RPT-Myreport-DO-PRINT-RTN 
      *After do print paragraph 
               PERFORM Myreport-AfterDoPrint 
        END-PERFORM 
           . 
      *{Bench}end 

Note that the Before and After do print paragraphs are inside AcuBench tags, which enables your code to become part of the AcuBench generated code.

With BeforeDoPrint and AfterDoPrint events, there is also a new variable generated for each report. Its definition is:

77 Myreport-DOPRINTRTN-LOOP PIC 9 VALUE 0

This variable is the switch that starts and stops the loop. To start the loop and thus the printing of data, you need to add a line of code similar to this one at the beginning of the PERFORM Myreport-BeforeDoPrint paragraph:

MOVE 1  TO Myreport-DOPRINTRTN-LOOP