It is often useful to know which are the most heavily accessed files in your system. Perhaps you would like to know which files have the most updates, deletes or reads. Or which files are opened and closed the most. Such information can be useful in profiling individual programs, spotting performance bottlenecks and ensuring your system runs smoothly.
There are many ways to determine such information, including performance tools, but journaling may be a better option. It's easy to use journaling to gather information about the number of updates to a file, and it takes little or no preparation or overhead. The information is stored in each file object and can be extracted by simply using the DSPFD command.
Specifically, DSPFD with TYPE(*MBR) displays how many times since the last IPL each file has been opened, closed, cleared, reorganized or has had its access path rebuilt. At record level, it tells you how many writes, updates, deletes and reads (both logical and physical) have been performed. Strictly speaking, the information is per member, rather than per file.
Such information is especially useful if it's collected on a regular basis. For example, you could set up a job that runs once a day and writes the data to an outfile. You can then analyze day-by-day changes using query, or perhaps a simple program. Any unexpected spikes in activity can alert you that a program may be malfunctioning. It will not tell you which program is misbehaving, but it can be a useful early warning.
I have also used this technique during development to ensure that files are being read and updated as expected. More than once I've noticed that a file was being read many more times than the design would suggest and have been alerted to what could have become a performance issue.
About the author: Nick Hobson is director of Q-SYS Technology Ltd. based in the U.K. He has worked in IT for almost two decades and has worked on the AS/400, lately iSeries, for 12 years.
- Get rid of deleted records and improve performance
As with most things in life, as your databases grow older, the larger and slower they become. The good news is that you can do something about it. Site expert John Kohan shows you how, using the DSPFD command.
- Find based on physical file for logical file used
Member Azmat Bhatti says you can use the DSPFD with Access Path parameter to find out the physical file the logical file is pointing to.