gtpd1m2fDatabase Reference

Use of Pool Records

The objects used internally by TPFCS to represent collections and their elements are stored in TPF long-term 4-K pool records. TPFCS will use FARF3, FARF4, or FARF5 4-byte file addresses or FARF6 8-byte file addresses. The type of address that is used depends on two things: whether the TPF system has been set to allow FARF6 file address dispensing or when the collection was created. Once the TPF system is set to allow FARF6 file address dispensing, all new collections will be created using 8-byte file addresses. To set the TPF system to allow 8-byte file addressing, enter ZMODE 6 to set on the SB8BFAD SYSTC switch (see TPF Operations for more information about the ZMODE command). To begin using 8-byte file addressing, you must use the record ID attribute table (RIAT) characteristics associated with the TPFCS record IDs (4-byte collections use RIAT RTP=0 and 8-byte collections use RIAT RTP=1). The following section describes how TPFCS logical objects are physically represented on DASD.

TPFCS Primary and Shadow Records

When a collection is created using the shadow option, TPFCS maintains a duplicate copy of each of the records used to represent the collection in the TPF database. This duplication feature that TPFCS provides is known as shadowing, and all collections that are duplicated in this way are said to be shadowed. TPFCS provides shadowing independent of TPF duplication of files. This means that if the pool records used to represent a shadowed collection are duplicated by the TPF system, there are four copies of each record.

The first copy of each record TPFCS uses to represent a collection is known as a primary record. If a collection is not shadowed, TPFCS uses only primary records to represent the collection. If the collection is shadowed, TPFCS maintains a copy of each primary record used to represent the collection. Each copy is known as a shadow record or simply, a shadow. Any time it needs to read one of these records, TPFCS can randomly read the shadow of that record rather than the primary copy of that record to maintain database integrity.

See TPF Operations for more information about the ZOODB DEFINE command with the SHADOW parameter.

TPFCS Record Header

Figure 23 describes the record header that TPFCS uses to file its objects in 4-K pool records using the 4-byte file address format:

Figure 23. DSECT Showing the 4-Byte Format Record Header

IDSDGP   DSECT
DGPTPF_HDR DS  0XL24               TPF record header
DGPRID     DS  XL2                 record ID
DGPRCC     DS  X                   record code check
DGPCTL     DS  X                   record format flag
DGPFORMAT1 EQU X'01'               1 - current format
*                                  other value reserved for future use.
DGPPRGNM   DS  XL4                 program name
DGPFWD     DS  XL4                 reserved
DGPBKD     DS  XL4                 reserved
DGPPRIME   DS  XL4                 file address of primary record
DGPSHADOW  DS  XL4                 file address of shadow or zero
DGPTPF_HDR_SIZE EQU *-DGPTPF_HDR

Figure 24 describes the record header that TPFCS uses to file its objects in 4-K pool records using 8-byte file address format:

Figure 24. DSECT Showing the 8-Byte Format Record Header

 IF6DP    DSECT
 I6PTPF_HDR DS  0XL48               TPF record header
 I6PRID     DS  XL2                 record ID
 I6PRCC     DS  X                   record code check
 I6PCTL     DS  X                   record format flag
 I6PFORMAT0 EQU X'00'               0 - current format
 I6PFORMAT1 EQU X'01'               1 - current format (alternative)
 I6PFORMAT2 EQU X'02'               2 - expanded (FARF6) format
 I6PPRGNM   DS  XL4                 program name
            DS  XL4                 Reserved for future IBM use
            DS  XL4                 Reserved for future IBM use
 I6PFWD     DS  XL8                 file address of next in chain
 I6PBKD     DS  XL8                 reserved
 I6PPRIME   DS  XL8                 file address of prime
 I6PSHADOW  DS  XL8                 file address of shadow or 0
 I6PTPF_HDR_SIZE EQU *-I6PTPF_HDR      

It is important to note how prime and shadow fields are used. Consider the following example using the 4-byte file address format in which the pool record at file address 180BF6A6 is used by TPFCS:

Figure 25. TPF Collection Support Primary Record Header Using 4-Byte File Addresses

+--------------------------------------------------------------------------------+
|User:   ZDFIL 180BF6A6 000.1F                                                   |
|                                                                                |
|System: CSMP0097I 16.32.50 CPU-B SS-BSS  SSU-HPN  IS-01                         |
|        DFIL0010I 16.32.50 BEGIN DISPLAY OF FILE ADDRESS 180BF6A6               |
|         00000000- FC160100 C3D1F0F0 00000000 00000000 ....CJ00 ........        |
|         00000010- 180BF6A6 180BF6A7 0000004C 00000000 ..6w..6x ...<....        |
|        END OF DISPLAY - ZEROED LINES NOT DISPLAYED                             |
+--------------------------------------------------------------------------------+

In Figure 25, the primary record points to itself because, at the displacement corresponding to its DGPPRIME field, the file address of the primary record (180BF6A6) is stored. The primary record also points to the shadow using DGPSHADOW, which contains the file address of the shadow record (180BF6A7). Likewise, the shadow record, whose contents match the primary record exactly, points back to the primary record using the DGPPRIME field as well as to itself through the DGPSHADOW field.

Figure 26. TPFCS Shadow Record Header

+--------------------------------------------------------------------------------+
|User:   ZDFIL 180BF6A7 000.1F                                                   |
|                                                                                |
|System: CSMP0097I 16.32.50 CPU-B SS-BSS  SSU-HPN  IS-01                         |
|        DFIL0010I 16.32.50 BEGIN DISPLAY OF FILE ADDRESS 180BF6A7               |
|         00000000- FC160100 C3D1F0F0 00000000 00000000 ....CJ00 ........        |
|         00000010- 180BF6A6 180BF6A7 0000004C 00000000 ..6w..6x ...<....        |
|        END OF DISPLAY - ZEROED LINES NOT DISPLAYED                             |
+--------------------------------------------------------------------------------+

If shadowing were not active for the record filed at file address 180BF6A6, our example might be as follows:

Figure 27. Primary Record Header with No Shadow

+--------------------------------------------------------------------------------+
|User:   ZDFIL 180BF6A6 000.1F                                                   |
|                                                                                |
|System: CSMP0097I 16.32.50 CPU-B SS-BSS  SSU-HPN  IS-01                         |
|        DFIL0010I 16.32.50 BEGIN DISPLAY OF FILE ADDRESS 180BF6A6               |
|         00000000- FC160100 C3D1F0F0 800814CE 00000000 ....CJ00 ........        |
|         00000010- 180BF6A6 00000000 0000004C 00000000 ..6w..6x ...<....        |
|        END OF DISPLAY - ZEROED LINES NOT DISPLAYED                             |
+--------------------------------------------------------------------------------+

We know that the record is not shadowed because the displacement that corresponds to the DGPSHADOW field contains zero.

TPFCS Record Trailer

In addition to having a header, the records in which TPFCS files its objects contain a trailer. The following DSECT outlines the contents of this trailer:

Figure 28. Contents of the TPFCS Record Trailer

              DSECT
DGPPG_TRAILER DS  0XL14            OODB PAGE TRAILER
DGPPG_RRN     DS  XL4              RRN of this record
DGPPG_ID      DS  XL8              File address of the owning control record
DGPPG_RESV    DS  X                reserved for future use
DGPPG_FFLG    DS  X                TPF format flag

For more information about a relative record number (RRN), see Extended Structures (StructureDasd Class). For more information about the owning control record, see Collection Control Record.


 


LINE.6