Exceptions are expensive to process.
If you use record I/O, you can minimize exceptions by using the rtncode=y option on _Ropen(). Exceptions are not generated for the following conditions:
When these conditions occur, the num_bytes field of the _RIOFB_T structure is updated and errno is set, but no exceptions are generated. For the "Record not found" condition, the num_bytes field is set to zero. For the "End-of-File" condition, the num_bytes field is set to EOF.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.