bdfd1m1nDatabase Administration

Reducing Overflow by Frequent Packing

The following scenario addresses reducing overflow by frequent packing.

Problem

A TPFDF subfile is often read but rarely updated. It contains small LRECs (20 bytes). Because the LRECs are small in comparison with the block size, the subfiles are not usually repacked when an LREC is deleted. As a result, LRECs are eventually scattered over a large number of blocks. This makes reading the subfile unnecessarily slow.

Solution

You could use the PACK parameter every time a subfile is closed. However, this would involve a substantial processing overhead. When closing a subfile, the TPFDF product packs it if any block is less than the threshold specified in global set symbol &SW00PIN.

If the LRECs in the block occupy less than the percentage specified in &SW00PIN, the TPFDF product packs the block up to the level defined in the DBDEF PLI parameter. If the PLI parameter is not specified, the blocks are packed until they are full.

You can override the &SW00PIN set symbol with the DBDEF PIN parameter. If you increase the PIN value to a higher figure, the TPFDF product packs the file more frequently. This reduces the number of overflow blocks in the subfile.

DSECT Set Symbols

No changes are necessary if the changes are made in the DBDEF macro.

DBDEF Statements

      DBDEF   FILE=zzzzzz,PIN=80

Application Coding

Not applicable.