Obtaining the subchannel number for a unit control block (UCB)

The IOSINFO macro obtains the subchannel number for a specified UCB from the system without being dependent on the location or format of the information as it is maintained in the UCB. The macro returns the subsystem identification word (SID), which identifies the subchannel number of the UCB, in a user-specified location. The SID is a fullword value; it contains the subchannel number in its ending halfword. (The first halfword contains X'0001'.)

IOSINFO obtains the number of the subchannel that was associated with the UCB at NIP time. However, the subchannel and the UCB might become disassociated during system operation. Any disassociation of the UCB and the subchannel means the subchannel number in the SID might not be valid. Therefore, IOSINFO returns information consistent with NIP time but does not guarantee that the subchannel will always be associated with the UCB.

If the UCB is disassociated from the subchannel at the time of the IOSINFO macro invocation, IOSINFO can detect the situation and notify the user through a return code. If the UCB is disassociated from the subchannel after the IOSINFO macro invocation, IOSINFO can not notify the caller. Instructions for coding the macro appear in z/OS MVS Programming: Authorized Assembler Services Reference EDT-IXG.