Exit protocol

The I/O exit provides record-level support. Z Data Tools performs all the I/O functions and the exit can process the record after it is read or before it is written. The exit supports the following protocol:
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).
Z Data Tools 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. Z Data Tools 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 Z Data Tools for information about messages returned by your exit.

Z Data Tools closes the data set after returning from the exit.
The exit performs any required 'cleanup' processing.