title: COBOL table structure and output
body: <p>I'm trying to userstand how this works: </p>
  
  <pre><code>WORKING-STORAGE SECTION.
  01 PAY-TABLE.
      05 PAY-VALUES OCCURS 25 TIMES PIC 9(3)V99.
  01 WORKING-VALUES.
      05 SUB PIC 9(2) VALUE ZERO.
  
  PROCEDURE DIVISION.
  INITIALIZE-ROUTINE.
  INITIALIZE PAY-TABLE
  
  MAINLINE-ROUTINE.
  PERFORM LOAD-TABLE
      VARYING SUB FROM 1
          BY 1
                UNTIL SUB&gt;10.
  DISPLAY-ROUTINE.
  DISPLAY PAY-VALUE (SUB)
  
  LOAD-TABLE.
  MOVE SUB TO PAY-VALUE (SUB). 
  </code></pre>
  
  <p>I have this code as a review code in the book. There are several questions according to this code, with answers, however, I don't really understand why should it be exactly this answer.</p>
  
  <blockquote>
    <ol>
    <li><p>The DISPLAY statement will display the value _____ on the monitor.<br>
    Answer: unknown</p></li>
    <li><p>When the value of SUB in the PERFORM statement is equal to 9, the value in PAY-VALUE (SUB), before the PERFORM executes, will be equal to:<br>
    Answer:10</p></li>
    <li><p>When the LOAD-TABLE routine has executed for the last time, the value in PAY-VALUE (25) will be:<br>
    Answer: 26</p></li>
    </ol>
  </blockquote>
  
  <p>I've tried to read tutorials about tables but still don't understand how this example works.</p>