Checking for input or output errors

After each input or output statement is performed, the file status key is updated with a value that indicates the success or failure of the operation.

About this task

Using a FILE STATUS clause, test the file status key after each input or output statement, and call an error-handling procedure if a nonzero file status code is returned. With VSAM files, you can use a second data item in the FILE STATUS clause to get additional VSAM status code information.

Another way of handling errors in input and output operations is to code ERROR (synonymous with EXCEPTION) declaratives.