bdfd1m1sDatabase Administration

Maintaining a Log File

The following scenario addresses maintaining a log file.

Problem

You want to log transaction data to a file for online access. The data becomes obsolete after a short time, so you want to keep only recent data. You do not want to write special maintenance and cleanup programs to maintain the log file.

Solution

The TPFDF product lets you control the number of overflow blocks by defining add current files. Each subfile consists of a prime block and a maximum number of overflow (pool) blocks. You specify the maximum number of overflow blocks in the DSECT (the range is 0 to 255).

The TPFDF product adds LRECs normally until it has allocated and filled all the allowed blocks. It then overwrites the oldest LREC with the new LREC that it is adding.

Implement this option by setting the number of blocks in the DSECT set symbol (&SW00NOC) and by setting &SW00OP1,#BIT2.

Caution:
Do not set this indicator for normal files. If you do, data will be lost when the wraparound process starts.

DSECT Set Symbols

      &SW00NOC  SETC   '3'
      &SW00OP1  SETC   '..1.....'

DBDEF Statements

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

Application Coding

      DBADD REF=zzzzzz,NEWLREC=location