Initialization call discussion

The I/O exit is always called, for any particular data set, first with one (and only one) initialization call. This is an opportunity for the exit to indicate the type of processing it will provide for the data set, for example, to allocate storage.

At initialization, the exit should decide whether to process the data set, and, if necessary, obtain dynamic storage.
  • Deciding whether to process the data set: the data set name and other information is available in the I/O exit control block. If the exit "knows" from the data set name and other information that it should not process the data set, the exit should indicate that Z Data Tools should not call the exit again. There are two ways to do this:
    • Only at initialization, you can set the level support field to 0. This indicates that Z Data Tools should not call the exit.
    • In response to any I/O exit call, you can set the exit return code to 4 (warning), and set the warning code to 2, to avoid further calls, and let Z Data Tools handle the remaining I/O without the exit.

    Otherwise set the level support field to 1 to indicate that the exit will process the data set.

  • Obtaining dynamic storage:
    • Typically only an assembler exit needs to obtain storage. COBOL and PL/I storage and addressability is preserved between calls to the exit. However, Z Data Tools provides both a current input and a current output record buffer, so even an assembler exit may not need to allocate storage.
    • Pointers to allocated storage and other information can be saved in the user scratchpad area at the end of the I/O control block, and will be maintained between initialization and termination calls.

There is no reason to change the values in the Functions supported by exit field. Both read and write support are required, and this is the default.