Two commands that you can use to test and make recommendations about the best modulo for a file are ISTAT and HASH-TEST. You can also check the File Statistics Report regularly to look for files that may need reallocation. You will get a feel for how often to do this: it depends on how often the file is modified and how easy it is to access data in the file.
Once you have discovered a file that seems to be out of trim, you can use HASH-TEST to show how the items would be reallocated if you used a given test modulo for the file. HASH-TEST performs exactly the same function as ISTAT but on a "what if" basis. ISTAT and HASH-TEST are discussed in detail below, followed by a discussion of how to reallocate files with inefficient modulos.
For purposes of illustration, the results of these commands are shown for both the default Master Dictionary that is created in a new user’s account, and for the same data copied to another file with a different, much less effective modulo.
Analyzing File Structure with ISTAT
ISTAT produces a summary of the item distribution for a file and analyzes the structure of groups within the file. This item distribution summary can help you determine whether the current file structure is the best one for the file.
The next example shows the result of the ISTAT command run on the Master Dictionary of an account:
>ISTAT MD |
|||
|
|
|
|
FILE= MD MODULO= 7 |
15:36:03 DD MMM YYYY |
||
FRAMES |
BYTES |
ITMS |
|
1 |
1006 |
45 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1 |
595 |
28 |
*>>>>>>>>>>>>>>>>>> |
1 |
787 |
38 |
*>>>>>>>>>>>>>>>>>>>>>>>>>> |
1 |
898 |
42 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1 |
643 |
33 |
*>>>>>>>>>>>>>>>>>>>>>>> |
1 |
862 |
45 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1 |
1219 |
49 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
7 |
|
|
|
|
|
|
|
ITEM COUNT= 280, BYTE COUNT= 6010, AVG.BYTES/ITEM= 21.4 AVG.ITEMS/GROUP=40.0,STD.DEVIATION=7.4, AVG.BYTES/GROUP=858.5 |
The example above illustrates that items are distributed evenly, with an average of 40 items in each group.
Testing File Structure with HASH-TEST
The example below illustrates that items are distributed evenly, with an average of 40 items in each group.
HASH-TEST produces the same listing as ISTAT shown above, but on a "what if" basis. You can thus preview what the distribution of records into groups would be if you were to choose a new modulo.
The next example shows the result of the HASH-TEST command run on the same Master Dictionary as was used in the preceding section with ISTAT. A test modulo of 3 has been used instead of the actual modulo of 7:
>HASH-TEST MD TEST MODULO:3 |
|||
|
|
|
|
= MD MODULO= 3 |
15:44:46 DD MMM YYYY |
||
FRAMES |
BYTES |
ITMS |
|
1 |
1740 |
78 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>! |
2 |
2005 |
98 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>! |
2 |
2265 |
104 |
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>! |
5 |
|
|
|
|
|
|
|
ITEM COUNT= 280, BYTE COUNT= 6010, AVG. BYTES/ITEM= 21.4 AVG.ITEMS/GROUP=93.3,STD.DEVIATION=13.6,AVG.BYTES/GROUP=2003.3 |
The example above illustrates that items are poorly distributed, and there are too many characters in each group. The items are not nearly so well distributed, with an average of 93 items in each group, and the average number of characters in each group exceeding one frame. The exclamation point at the end of each item distribution line indicates that there are more items in each group than can be shown in the report.
On the other hand, with a test modulo of 79, we get this result:
>HASH-TEST MD TEST MODULO:79 |
||
|
|
|
FILE= MD MODULO= 79 15:54:46 DD MMM YYYY |
||
FRAMES |
BYTES |
ITMS |
1 |
119 |
5 *>>>>> |
1 |
178 |
9 *>>>>>>>>> |
1 |
34 |
2 *>> |
1 |
119 |
6 *>>>>>> |
1 |
24 |
1 *> |
1 |
0 |
0 * |
1 |
79 |
4 *>>>> |
1 |
0 |
0 * |
. |
|
|
. |
|
|
. |
|
|
1 |
62 |
2 *>> |
1 |
0 |
0 * |
1 |
105 |
6 *>>>>>> |
1 |
36 |
2 *>> |
79 |
|
|
|
|
|
ITEM COUNT= 280, BYTE COUNT= 6010, AVG. BYTES/ITEM= 21.4 AVG.ITEMS/GROUP= 3.5,STD.DEVIATION= 2.0,AVG.BYTES/GROUP= 76.0 |
In the example above, there are too few items per group as well as too few characters in each group. Here things are just as bad, but in the opposite direction: several of the frames are empty, and only four percent of the space allocated to each group is being used—a very inefficient use of disk drive space.
See Also