Obtaining the Sector Number of a Block on an RPS Device
For programs that can be used with both RPS and non-RPS devices, test the UCBRPS bit (bit 3 at offset 17 of the UCB) to determine whether the device has rotational position sensing. If the UCBRPS bit is off, do not issue a channel program with a Set Sector command to the device. The address of the sector conversion routine's entry point is in the CVT0SCR1 field of the CVT.The IBM® DS8000® and newer storage subsystems accept the Set Sector command, but the command has no effect.
Your program can call the conversion routine by issuing a BASR 14,15 or BAS 14,16(,15) instruction. If you are passing the track balance to the routine, invoke the routine using a BAS 14,8(15) or BAS 14,20(,15). If you are computing the sector value on modulo devices with variable length records, pass the track balance to the sector convert routine.
- The sector convert routine does not support PDSEs or extended format data sets. Using the sector convert routine against a PDSE or extended format data set returns results that are inconsistent with the physical record format.
- The sector convert routine does not support data sets that are not DASD or do not have a UCB. Examples include tape, dummy data sets (DD DUMMY), spooled data sets (*, DATA or SYSOUT), TSO terminals and z/OS® UNIX files such as zFS and HFS files. You will receive unpredictable results if you use the conversion routine with a data set or file that is not on DASD or does not have a UCB.
For RPS devices, the conversion routine does all its work in general registers. Load registers 0, 2, 14, and 15 with input to the routine. Register usage is as follows:
Register | Use |
---|---|
0 | For fixed, standard blocks or fixed, unblocked records not
in a partitioned data set: Register 0 must contain a 4-byte value
in the form XXKR, where:
To indicate fixed-length records, turn off (set to 0) the high-order bit of register 0. Passing the track balance: Register 0 must contain a 4-byte value of the track balance of the record preceding the required record. For all other
cases: Register 0 must contain a 4-byte value in the form BBIR, where:
|
1 | Not used by the sector-convert routine. |
2 | When called at offset 0 or 8, must contain a 4-byte field where:
If called at offset 16 or 20, must contain the address of a 1-byte area that is to receive the sector value. |
3-8 | Not used. |
9-10 | Used by the convert routine and not saved or restored. |
11 | If called at offset 0 or 8, not used. If called at offset 16 or 20, contains 1-byte UCBTBYT4 code in the low-order byte. The remaining three bytes must contain zero. |
12,13 | Not used. |
14 | Must be loaded with the address in which control is to be returned after execution of the sector conversion routine. |
15 | Used by the conversion routine as a base register and must be loaded with the address of the entry point to the conversion routine (from field CVT0SCR1 of the CVT). |