UFT/FTI examples

The heart of the expanded addressing scheme represented by FARF4, FARF5, and FARF6 is the UFT/FTI. The UFT/FTI design uses a hierarchical technique for dividing very large amounts of file address space. A UFT points to several FTIs and each FTI potentially points to a split in the FACE table. The UFT and FTI are part of a file address. Together with a record ordinal number, a UFT/FTI combination specifies a file address in the database.

The UFTI parameter on the UFTFTI statement specifies a UFT followed by the FTI size. The FTI size specifies a length, in bits, of FTIs to be coded for a particular UFT. It is not the FTI itself. The UFT/FTI pairs coded on the UFTI parameter are used only for FARF4 and FARF5 addresses. The UFT/FTI pairs coded on the UFTI6 parameter are used only for FARF6 addresses.

For example:
     UFTFTI  UFTI=((3,8),(4,12))
specifies a slice starting at UFT 3 comprising up to 256 (that is, 28) FTIs, and a slice starting at UFT 4 comprising 4096 FTIs.
For example:
     UFTFTI  STAGE=FARF45,MODE=FARF5,
             UFTI=((0,8),(1,12),(2,10),(61,16),(62,14),(63,12),
             (20,23),(21,25)),
             UFTI6=((2,10),(30,15)) 
Note: FARF6 addresses are dispensed in either FARF34 or FARF45 address mode.
The meaning of the UFTI parameter on this statement is:
  • UFT 0 has an 8-bit FTI associated with it. This means there are 28 (256) UFT/FTI address pairs that may be used.
  • UFT 1 has a 12-bit FTI associated with it. This UFT/FTI combination specifies 4096 UFT/FTI pairs.
  • UFT 21 has a 25-bit FTI associated with it. This combination provides 33␠554␠432 UFT/FTI pairs.
  • The UFTI6 parameter defines two UFT/FTI pairs 2,10 and 3,15. The same UFT can be used for FARF4/5 addresses as well as for FARF6 addresses.
The FTI size, in bits, defines the number of valid FTI numbers that can be associated with a particular UFT. In turn, the UFT/FTI combination limits the number of ordinals that can be represented by the combination. Because the number of UFT bits is fixed (at 6 bits for FARF4 and FARF5 and 16 bits for FARF6), once the FTI length is set, the maximum number of ordinals for the record type is also set. The maximum number of ordinals is represented by the remaining bits in FARF5 or FARF6 addresses and by the remaining bits minus 2 additional control bits in FARF4 addresses. While FARF addressing is described in detail in the z/TPF Database User's Guide, FARF4, FARF5, and FARF6 addresses are distinguished graphically by Figure 1.
Figure 1. FARF4, FARF5, and FARF6 addresses
Alternative text description not available.

Ellipses (…) in the figure represent the variable nature of the FTI.

UFTI pairs can be defined for both FARF4 and FARF5. The UFTI4 and UFTI5 parameters on the RAMFIL macro statement contain actual UFT,FTI pairs. The following is valid assuming the previous UFTFTI statement:
     RAMFIL TYPE=LSA,RECNO=00014,RECID=#APPOP,DUPE=YES,BAND=1616,
            BASE=00800,UFTI4=(61,20),UFTI5=(61,21)

The UFTI4 parameter states that the FARF4 address for record ID #APPOP has 61 as a UFT and 20 as an FTI. UFT 61 is defined earlier as having a 16 bit FTI, so all FTIs ranging between 0 and 216 -1 (65␠535) are valid. The UFTI5 parameter defines a FARF5 address for #APPOP with a UFT of 61 and an FTI of 21. Note that the same UFT can be used for both FARF4 and FARF5 addresses but a UFT/FTI pair can only be used once.

Here is another example:
     UFTFTI UFTI=((10,6),(11,6))
     RAMFIL RECID=#FRED,RECNO=100,BAND=10,UFTI4=(10,1),UFTI5=(11,1)
     RAMFIL RECID=#BILL,RECNO=101,BAND=11,UFTI4=(10,2),UFTI5=(11,2)
     RAMFIL RECID=#EDNA,RECNO=102,BAND=12,UFTI4=(10,3),UFTI5=(11,3)
UFT 10 has an FTI length of 6 bits, so there are 26 (64) FTIs pointed to by UFT 10. The maximum number of ordinals in each slot is as follows:
    32 bits
  - (6 bits UFT length + 6 bits FTI length)
  ---------
    20 bit ordinal number or ordinals < 220 (1␠048␠
or
  - (2 FARF4 control bits)
  ---------
    18 bit ordinal number or ordinals < 218 (262␠144) for F

UFTs and FTIs can be thought of as first and middle names, while ordinals can be considered last names. Every unique record ordinal needs a unique first, middle, and last name.

For example:
     UFTFTI  UFTI=((3,22),(5,21)),MODE=FARF4
     RAMFIL  RECID=#FRED,RECNO=16,UFTI4=((3,1026),(5,24),(3,437)),TYPE=S SA

A series of record ordinals is specified by the following RAMFIL macro statement. The type of record is #FRED. There are 16 small ordinals on device A. UFTI4 indicates they are FARF4 record ordinals that are divided among 3 UFTI pairs. The first pair (3,1026) is the first and middle name for the first group of four ordinals. The last names for these are 0, 1, 2, and 3. The second group of ordinals is specified by the (5,21) pair. The second group has 3 bits available according to the previous UFTFTI macro and this allows 8 ordinals: 0, 1, 2,..., and 7. Finally, the third group has 2 bits, because it is governed by the UFT 3, and so 4 ordinals.

Shown graphically, the 16 ordinals specified by this RAMFIL macro statement are distributed over 3 UFTI pairs.
              UFT=3|       UFT=5     |   UFT=3
           FTI=1026|      FTI=24     | FTI=437
                   |                 |
  ordinals: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
                   |                 |
Written out, the addresses for the ordinals are:
     #FRED ordinal  0:  3 1026 0
           ordinal  1:  3 1026 1
           ordinal  2:  3 1026 2
           ordinal  3:  3 1026 3 _____
           ordinal  4:  5   24 0
           ordinal  5:  5   24 1
           ordinal  6:  5   24 2
             ⋮      ⋮   ⋮    ⋮ ⋮
           ordinal 11:  5   24 7 _____
           ordinal 12:  3  437 0
           ordinal 13:  3  437 1
           ordinal 14:  3  437 2
           ordinal 15:  3  437 3

Observe that when a new UFTI pair starts, the ordinal number index in the address begins again at zero.

Thinking about UFTI pairs and ordinal numbers as names helps to clarify how UFTFTIs are structured. Each first and middle name pair specified by the UFTI pairs implies a limited set of ordinal indexes, as shown earlier. Moreover, each first name has a large set of middle names that go with it. As with (3,22), the previous example we have 222 possible middle names. Putting these middle names together with the ordinal index results in a diagram of addresses as follows:

       U   F   O
       F   T   r I
       T   I   d n
               i d
               n e
               a x
               l
       -   -   -
       3   1   0
       3   1   1
       3   1   2
       3   1   3
       3   2   0
       3   2   1
       3   2   2
       3   2   3
       3   3   0
       3   3   1
       3   3   2
       3   3   3
       ⋮   ⋮   ⋮
       3 222 0
       3 222 1
       3 222 2
       3 222 3
You could make a similar diagram for the pair (5,21), with the only exception being the last group of ordinal indexes distinguished by their middle names is as follows:

       U   F   O
       F   T   r I
       T   I   d n
               i d
               n e
               a x
               l
       -   -   -
       :   :   :
       5 221 0
       5 221 1
       5 221 2
       5 221 3
       5 221 4
       5 221 5
       5 221 6
       5 221 7