gtpd1m2mDatabase Reference

How Some Objects Are Condensed to Save Space

As mentioned previously, TPFCS sometimes condenses compact structure objects that contain data areas by removing unused portions of the data area before filing those objects. TPFCS condenses such objects to save DASD space. When the object is filed on DASD, it appears as follows:

Figure 50 clarifies these points. Consider the following object as it appears in memory as the TPF system accesses it to process application requests against an associated collection:

Figure 50. How an Object Containing a Data Area Appears in Memory


Each data entry is a field in the data area where collection elements are stored. In objects such as these, the collection elements need to be sorted. As was discussed previously for compact structures, TPFCS normally inserts elements that need to be sorted into the data area as they arrive, and locators are used to retrieve the elements in correct order as if they were sorted.

Also, as discussed previously, when using locators, TPFCS inserts data entries starting at the top of a data area working downward, and adds locators to the same data area starting at the bottom and working backward. This practice leaves a gap of unused bytes between the last data entry and the displacement where the locators are stored. This gap of unused space is where additional entries are added as applications add or insert more elements in the associated collection.

Recall that objects with locators contain control information attributes as well as a data area. Depending on the specific object, these attributes can occur before the data area, after it, or at both locations. The control information attributes determine information such as the entire size of the data area (including unused bytes), the number of unused bytes, the displacement in the data area where the unused bytes begin, and so on. TPFCS will use this information to determine whether there is room for the data entry, as well as where in the data area to store the entry, when inserting an additional data entry into the object data area. Besides having the length of its data area in one of its control information attributes, the object has its entire length stored in the object header.

Figure 51 shows how the same object is condensed for space saving when it is filed in a record on DASD:

Figure 51. How an Object Containing a Data Area with Locators Appears after Space Saving


The data area of the object is now much smaller because the gap of unused bytes between the last data entry and the beginning of the locators is no longer present. This is the only difference between how the object appears in memory and how it is stored on DASD. For example, the contents of the following are not changed:

Note:
The only objects that TPFCS condenses on DASD for space saving are those indicated in Compact Structures (StructureMem Class). Objects filed in data records listed under Extended Structures (StructureDasd Class) are not condensed.