Grids Generated With LoadGridInit and LoadGridNext

If you defined LoadGrid events, the code to populate the grid is automatically added to the .cbl source file and looks something like this:

*{Bench}myreport:mygrid:-dogridrtn 
       Acu-mygrid-TABBODY. 
           PERFORM Acu-Initialize-mygrid 
      *(Bench}initial grid load para 
           PERFORM mygrid-LoadGridInit 
           PERFORM UNTIL myreport-mygrid-LOADGD-SW = 0 
                PERFORM Acu-mygrid-TabbodyPrintLoop 
      *(Bench}next grid load para 
              PERFORM mygrid-LoadGridNext 
           END-PERFORM. 
 
           PERFORM Acu-CLOSE-mygrid 
           . 
      *{Bench}end 
      * 

With LoadGrid events, there is also a new variable generated for each report. It's definition is as follows:

77 myreport-mygrid-LOADGD-SW 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 mygrid-LoadGridInit paragraph:

MOVE 1  TO myreport-mygrid-LOADGD-SW