SECTVAL (Sector-Value Calculation) Macro

The macro calculates the sector value of the start of the requested record on the track of a disk storage device when RPS is used.

The macro returns this value in register 0. If an error is detected in calculating the sector value, the system returns a no-operation sector value (X'FF').

The sector value is calculated from data length, key length, and record number (except record number 0) information. Values are calculated for fixed or variable-length and for keyed and non-keyed records.
Note: If LOGUNIT or DVCTYP are not supplied in a register, the address of the named field must not be based on register 1.

Format

Read syntax diagramSkip visual syntax diagramnameSECTVAL DDKR=name1(0),RECFORM=FIXVAR,LOGUNIT=name2(1),DVCTYP=name3(1)

Requirements for the caller

AMODE:
24 or 31
RMODE:
24 or ANY
ASC Mode:
Primary

Parameters

DDKR=name1 | (0)
The information that is needed to calculate the sector value should be specified in the 4-byte field at name1, or in the specified register. The 4 bytes of information have the format ddkr, where
dd =
Two-byte field, which specifies for:
  • Fixed-length records, the data length of each record.
  • Variable-length records, the total number of user data bytes written on the track after R0 up to the requested record.

If the k and r bytes are zero, the dd field is considered a 16-bit number that specifies the total number of bytes (including all gaps, keys, and overhead) that were written on the track after R0 and the home address. Therefore, a sector value should not be requested for record 0 (fields kr=0000).

k =
A 1-byte field that indicates the key length for:
  • Fixed-length records, the actual key length must be specified.
  • Variable-length records, any nonzero value is sufficient to indicate the presence of keys.
Note: For non-keyed records the value should be 0.
r =
A 1-byte record number field, which specifies the number of the record of which the sector value is being requested. Do not specify record number 0, unless you use the special interface that is described above.
RECFORM=FIX | VAR
Specifies whether the records are of fixed- or variable length format.
LOGUNIT=name2 | (1)
Specifies the logical unit number of the device, either in a 2-byte field at name2 or in the two low-order bytes of the specified register (that is, right-adjusted). See Note.
DVCTYP=name3 | (1)
Specifies the DTF device type code, either in a 1-byte field at name3 or in the low-order byte of the specified register (that is, right-adjusted). The remaining bytes of that register are assumed to be zero. See Note.
The following device type codes (the same as those contained in the DTF block) are valid for IBM® disk devices as indicated:
      IBM Device                Code
      3375                      X'0B'
      3380                      X'0C'
      3390                      Use the LOGUNIT operand or the GETVCE macro
      3390 Model 1              X'26'
      3390 Model 2              X'27'
      3390 Model 3              X'24'
      3390 Model 9              X'32'
      9345                      X'04'