Exit protocol
- Initialization
- The exit indicates that the specified data set is to be processed by the exit and returns information about supported functions (once per data set).
- Open
- File Manager opens the data set and provides vital information about the data (multiple possible per data set).
- A series of record access calls implementing the following functions:
-
- Record read
- Record write
The record to be processed is provided in an input buffer. The exit should process the data and return it in the output buffer while setting the output (record) length. A length of zero for the output record indicates that the processing did not change the record and the input record can be used "as is".
At any time during read/write processing the exit can indicate that it should no longer process the current data set. File Manager will then stop invoking the exit for read/write processing and continue processing without the involvement of the exit. The Close and Terminate calls will still occur.
Note: The read and write requests may occur in random record order. No assumption about data processing should be made based on such order. This is important with some encryption technologies which require a sequentially ordered data stream.Error codes can be set and messages returned by the exit to be displayed or printed for the user. Some codes immediately terminate the current function while some allow for continued processing. The messages are displayed regardless of the return code every time there is a non-blank message returned by the exit. See also Information that should always be returned from the I/O Exit to File Manager for information about messages returned by your exit.
- Close
- File Manager closes the data set after returning from the exit.
- Termination
- The exit performs any required 'cleanup' processing.