The IOSINFO macro obtains the subchannel number for a specified unit control block (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 whose first halfword contains X‘0001’ and ending halfword contains the subchannel number.
Additionally, the issuing program must include the CVT and IHAPSA mapping macros. All addresses must be 31-bit addresses and the issuing program must pass a below 16 megabyte actual or captured UCB.
Before entry to this macro, register 13 must contain the address of a standard 18-word save area.
After the caller issues the macro, the macro might use some registers as work registers or might change the contents of some registers. When the macro returns control to the caller, the contents of these registers are not the same as they were before the macro was issued. Therefore, if the caller depends on these registers containing the same value before and after issuing the macro, the caller must save these registers before issuing the macro and restore them after the system returns control.
The IOSINFO macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede IOSINFO. |
IOSINFO | |
␢ | One or more blanks must follow IOSINFO. |
FUNCTN=SUBCHNO | |
,UCB=ucb addr | ucb addr: A-type address or register (0) - (15). |
,OUTPUT=output addr | output addr: A-type address or register (0) - (14). |
,RTNCODE=retcde addr | retcde addr: A-type address or register (0) - (15). |
The parameters are explained as follows:
The SID is a fullword value that identifies the subchannel. The first halfword is X‘0001’, and the last halfword contains the subchannel number.
The output address must reside in 31-bit addressable storage.
The return code address must reside in 31-bit addressable storage.
When control returns from IOSINFO, GPR 15 (and retcde addr, if you coded RTNCODE) contains one of the following return codes:
Hexadecimal Code | Meaning |
---|---|
00 | The address specified on the OUTPUT parameter contains the SID.* |
04 | The UCB was disassociated from the subchannel at the time of the IOSINFO service routine invocation. |
* In some cases, the subchannel number in the SID might not be valid. Any disassociation of the UCB and the subchannel means the subchannel number in the SID is not valid. If the UCB is disassociated from the subchannel after the IOSINFO service routine invocation, no notification can be given.
IOSINFO FUNCTN=SUBCHNO,UCB=(1),OUTPUT=(2),RTNCODE=(3)
IOSINFO FUNCTN=SUBCHNO,UCB=ADDR,OUTPUT=ADDX,RTNCODE=(3)
IOSINFO FUNCTN=SUBCHNO,UCB=(2),OUTPUT=(3),RTNCODE=ADDR