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 MVS 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.
An optional parameter, IOCTOKEN, is available with the UCBSCAN
macro. 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 specified as input by the caller.
Use the following ways to obtain the current MVS I/O configuration
token:
- Issue the IOCINFO macro.
- Issue the UCBSCAN macro, setting the input specified by the IOCTOKEN
parameter to binary zeroes. The macro will then return the current
I/O configuration token at the start of the scan.
- Issue EDTINFO macro, setting the input specified by the IOCTOKEN
parameter to binary zeroes.
Use of the MVS 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 determine whether the I/O configuration changes during a
UCB scan. If the IOCTOKEN parameter is specified with UCBSCAN, the
caller will be notified through a return code if the set of UCBs changes
while the scan is in progress. Checking for this return code allows
the caller to restart the scan to ensure that copies of all UCBs in
the current configuration are obtained.
An unauthorized program can use the MVS I/O configuration
token to regularly check whether a configuration change has occurred,
as in the following example:
- The program issues the IOCINFO macro to obtain the MVS I/O
configuration token.
- The program sets a time interval that is to expire in 10 minutes,
using the STIMER macro.
- When the time interval expires, the user-specified timer exit
routine gets control and issues the IOCINFO macro to obtain the MVS I/O
configuration token that is current at this later time.
- The program compares the newly-obtained token with the original
one.
- If the tokens match, no I/O configuration change has occurred,
and the program resets the time interval for another 10 minutes to
check again at that time.
- If the tokens do not match, a configuration change has occurred.
The program then rebuilds its control structures by using the UCBSCAN
macro, specifying the IOCTOKEN parameter to check for any further
I/O configuration changes while the rebuilding process is in progress.
After the control structures are rebuilt for the new I/O configuration,
the program resets the time interval for 10 minutes to check again
for I/O configuration changes.