How can I re-read a file when I've already hit end of file?


After testing for EOF, you can issue an explicit CLOSE for the file (or SQL query) and then re-open the file. This is shown in the example below.

NOTE Using STOPAFT 1 will allow the file to be re-read only once.


  RD INDD

  IF EOF INDD
    THEN CLOSE INDD STOPAFT 1
    THEN GG         STOPAFT 1
    THEN EOJ