Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Migration Guide

IBM2421: CLOSE in ENDFILE

This message alerts you to a subtle coding error:

  IBM2421I E  A file should not be closed in its ENDFILE block.

While it may be tempting to close a file in your ENDFILE block for that file, you should not do this since doing so will lead to internal library errors. Instead, it is best to write your ENDFILE block so that it does nothing more than set a flag that will be tested after the READ or GET statement for the file. You should then close the file in the mainline code when it sees that this flag has been turned on.

Code that produces this message should be corrected.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)