Problem solve Get help with specific problems with your technologies, process and projects.

Using the WRKDSKSTS command to increase performance

Still running OPM programs? The Work With Disk Status (WRKDSKSTS) command can tell you a lot about your system -- information you can use to boost your system's performance.

If you're still running OPM programs, you're suffering considerably at the hands of ILE. As you know, OPM programs run slower than their ILE counterparts: Because the native environment on Version 3 is ILE, the OPM environment has to be emulated.

If you haven't been able to convert all your programs to ILE, but you still want to boost performance, you must look elsewhere. One of the places you should look is the work with disk status command (WRKDSKSTS). This command can tell you a lot about your system -- information you can use to boost your system's performance. We've also put together a few utility programs that use the WRKDSKSTS command to help you get even more horsepower out of your system.

Ron Turull

How to determine disk activity at the system level

The work with disk status command (WRKDSKSTS) will give you a quick picture of the activity of the disks in your system. Figure 1 shows you an example of the WRKDSKSTS display for a simple three-disk system. When the WRKDSKSTS command is run for the first time in a job, the elapsed statistics (those requiring a time interval to measure) are set to zero. This can also be forced by specifying *YES for the RESET parameter on the WRKDSKSTS command or by pressing the F13 key on the WRKDSKSTS display.

Figure 1: Example of the Work with Disk Status display for a three-disk system.

To see some elapsed numbers for your system, you must press either the

  • F5 key (refresh), which will measure the interval between the last time the statistics were reset.
  • F10 key (restart statistics), which is a specialized version of the F5 key. It is the equivalent of resetting the statistics the last time you pressed a function key (i.e., the last time the display was written to the screen) and pressing the F5 key presently. In other words, F10 will give you the statistics for the time interval measured from the time you last pressed an F-key to the present.

System level distribution is shown in the "% Used" column. The system will try to even these numbers out automatically. But if you have recently added a disk, you may see numbers way out of balance. In that case, you can help the system out by following one or more of the procedures discussed in the next installment.

The six columns following the "% Used" column show detailed information about the number of reads and writes per second requested during the elapsed time and the average size in KB of the data transferred. The first two of these six columns ("I/O Rqs" and "Request Size (K)") are figures for reads and writes combined, while the remaining four columns show statistics for reads and writes individually.

The last column on the WRKDSKSTS display ("% Busy") provides an estimate of the percentage of time a particular disk unit was busy during the elapsed time. Monitoring this column throughout a typical day will give you a pretty good idea of the distribution of disk activity at the system level. Note: When you exit the WRKDSKSTS display, the elapsed statistics are not reset the next time you execute the WRKDSKSTS command in the same job.

Time-saving program

If you're like me and don't really have time to monitor the WRKDSKSTS display all day, try out this time-saving program: PRTDSKRPT0. This program takes a number of five-minute time-elapsed "photographs" randomly spaced throughout the day (or for however long you run it). I have taken advantage of a utility program that I wrote, #CEERAN0. It returns a pseudo-random number between 0 and 1 in packed decimal format. You can substitute in your favorite random-number generator, or if you want a copy of this one, drop me an e-mail at

After you have let the program run for a day or two, you will have a series of printouts that can be studied. You are looking for equivalent numbers in the "% Busy" column.

You can also run this program-- PRTDSKRPT2 -- simultaneously to produce two 12-hour snapshots of the disk activity, one for day time and the other at night. These reports will give you a longer average, but remember it will include periods of very low activity (e.g., lunch time).

How to determine disk activity at the object level

If the activity figures (i.e., "% Busy") on the reports produced by these utility programs seem out of balance, it is time to start looking at distribution at the object level. The first targets -- large files. We need to determine if the file is evenly distributed over the available disk units. (Even if the numbers for your system look good, you may want to check you very large files anyway.)v

To do this, use the programs DSPFILDST and DSPFILDST0. These two programs make up a single utility that estimates the distribution of a file's data. This utility should be used only on a dedicated system or, best of all, while the system is in the restricted state. It can be run at other times, but the "noise" from other jobs on the system will render the information on the reports suspect at best and useless at worst.

The utility reads every record in the file you specify and then prints a WRKDSKSTS report. The figures in the "Read Rqs" column will indicate the relative distribution of the file's data. Uneven numbers in this column indicate an uneven distribution. A word of caution: Do not use this utility twice in a row for the same file without doing some other intervening work because the file's data may still be in the system's many caches.

More to come

In the next installment, we'll discuss what can be done to even out imbalances in your disks or the objects they contain. For now, take the time to run the reports and monitor your system for a while.

About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.


  • Three basic system tools to help you tune your iSeries
    The three basic performance management tools -- WRKSYSSTS, WRKDSKSTS and WRKACTJOB -- come with OS/400. Unfortunately, they aren't always put to the best use at the best time.
  • Speed up system with "STRASPBAL" member Mario Haeck says even though the WRKDSKSTS display shows a consistent I/O sharing between the disks, it does not always reflect reality.
  • Checking for failed RAID arrays member Justin Haase says SST is great for checking out your DASD, but there's a better command if you want a quick way to see if you've lost a drive over the weekend.

Dig Deeper on Integrated File System (IFS)

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.