Detecting I/O configuration changes

You can use the MVS™ I/O configuration token to detect I/O configuration changes. The MVS I/O configuration token is a 48-byte token that uniquely identifies an I/O configuration to the system. The token will change whenever the software configuration definition changes. Thus, if your program obtains the current I/O configuration token and compares it to one previously obtained, the program can determine whether there has been a change in the I/O configuration: If the tokens do not match, the I/O configuration has changed.

Both the MVS I/O configuration token and the ENFREQ macro (or the CONFCHG macro) with its related exit can be used to detect I/O configuration changes. (See Requesting notification of I/O configuration changes for information on the ENFREQ or CONFCHG macro and related exit routine.) However, there are two important differences:

An optional parameter, IOCTOKEN, is available with the UCB macros. Specifying IOCTOKEN ensures that the system will notify the caller through a return code and will not return any data if the current I/O configuration is not consistent with the configuration represented by the token that was specified as input by the caller.

There are two ways to obtain the current I/O configuration token:

Use of the I/O configuration token can help prevent data inconsistencies that might occur if the I/O configuration changes between the time the caller obtained the token and the time the service returns the information. For example, you can use the configuration token to identify a case in which the I/O configuration changes during a UCB scan. If the IOCTOKEN parameter is specified with UCBSCAN, the system will notify the caller through a return code if the set of UCBs changes while the scan is in progress. Checking for the return code would allow the caller to restart the scan to ensure that all UCBs in the current configuration are referenced.

Specifying IOCTOKEN also allows the caller to receive notification if a dynamic device reconfiguration (DDR) swap occurs. DDR SWAP causes a token change.

The I/O configuration token can also serve to identify that the relationship between a device number and a UCB address has changed. This could be useful when a device number or UCB address is saved along with a configuration token and used for later processing. For example, a program may obtain a device number from the EDTINFO macro. The program may then want to issue UCBLOOK to obtain the UCB address for that device number. To ensure that the device definition of the UCB address obtained from UCBLOOK is consistent with the definition of the device number obtained by EDTINFO, the configuration token can be used.

In some cases, a change in the relationship between device number and UCB can only be detected through the use of an I/O configuration token. For example: