I/O Exit Requests

The I/O exit is called with IBM® Connect:Direct® requests that are found in EXTOPER, which is a field in EXTCB. The following are the requests that the input and output I/O exits receive:

BEGIN Request

IBM Connect:Direct makes a BEGIN request to an I/O exit when it begins communication with the exit. The BEGIN is when the exit must allocate work areas in preparation for future requests and is the first request that an I/O exit receives.

OPEN Request

IBM Connect:Direct makes an OPEN request to an I/O exit when the exit allocates and opens the file. EXTDIR contains either S (Send) or R (Received) to indicate whether the file is to be read or written. The I/O exit uses EXTWKARA to anchor any storage obtained and set EXTMAXLN to the maximum record length.

INFO Request

IBM Connect:Direct makes an INFO request to an I/O exit when it wants the exit to retrieve the file attributes and place them into the INFO area (mapped by the DMINFO macro) which is pointed to by EXTVSWRK. These data set attributes are required by IBM Connect:Direct.

Set the following fields in the INFO control block. The values listed are an example of those needed for a sequential data set.

INBLKSZ	= F’80’	block size
INLRECL	= F’80’	record size
INTYPE	= CL4’PS’	data set organization
INRECFM	= CL4’ ’	blank
INUNIT	= CL8’ ’	blank
INBLKS	= F’0’	nulls
INUSEBLK	= F’0’	nulls
INBLKTRK	= F’0’	nulls
INTRKCYL	= F’0’	nulls
IN2NDRY	= 8C’0’	character zeros
INLOCTYP	= CL3’ ’	blanks
GET Request

IBM Connect:Direct makes a GET request to an I/O exit when it wants a record/block read into the buffer. EXTINLNG is set to the length of the data. EXTINARA points to the record obtained.

The exit must indicate normal END-OF-DATA condition to IBM Connect:Direct by returning a value of EXTRCEOD in EXTRTNCD. You may indicate other conditions by providing other values in the previously mentioned fields. The EXTRCEOD in EXTRTNCD values enable IBM Connect:Direct to issue messages that are added to the IBM Connect:Direct message file.

The IOEXIT must allocate a buffer for the input record/block. To determine if IBM Connect:Direct is expecting a record or block, the IOEXIT must examine the source LRECL, BLKSIZE, RECFM and destination LRECL, BLKSIZE, RECFM fields in the EXIT control block. If the source and destination data set attributes match, then IBM Connect:Direct is expecting a physical block from the IOEXIT, otherwise a logical record is expected.

ADD Request

IBM Connect:Direct makes an ADD request to an I/O exit when it wants a record/block to be inserted. EXTOTLNG is set to the length of the data. EXTOTARA points to the new record/block.

IBM Connect:Direct always sends RECFM=VS and RECFM=VBS files in segments rather than records. If EXTSPAN is set to Y, the data pointed to by EXTOTARA has two segments. Refer to the IBM library of manuals for information on the format of spanned records. The buffer referenced by EXTOTARA contains a physical block if the source and destination data set attributes match; otherwise, it contains a logical record.

CLOSE Request

IBM Connect:Direct makes a CLOSE request to an I/O exit when the file closes. Errors returned by the exit on this request are ignored. The EXTABN flag is activated if the CLOSE request is due to abnormal termination.

END Request

IBM Connect:Direct makes the END request to an I/O exit to end communication with the exit. The exit releases any work areas allocated when it received the BEGIN request. This request is the last request an I/O exit receives.