ow often do you get an emergency call from your system operator because a program is trying to add a record to a file that is already full? Sometimes you will find that the program is looping and making too many incorrect entries to the file. In that case, there is truly a problem and you need to investigate.
However, you may find that most of these calls are due to gradually increasing workload, and you need to increase the size of the file. In order to prevent emergency phone calls for this situation, you can find out in advance which files are near the maximum, and change the file size before it fills up.
To create a report on files nearing capacity for a library, start by using the command DSPFD and directing the output to an outfile. For example, for all physical files in the general ledger file library:
DSPFD FILE(GLFILES/*ALL)+ TYPE(*MBR)+ FILEATR(*PF)+ OUTPUT(*OUTFILE)+ OUTFILE(mylib/myfile)
The capacity of a file is calculated as follows:
Initial number of records + (number of increments * size of increment) = Capacity
In record format QWHFDMBR, this calculation has already been done, and the result is in field MBRCDC. The current number of records in the file is in field MBNRCD. It is helpful to determine how the current number of records relates to the capacity of the file. Use the create results feature in Query/400 to calculate the percent of capacity used for each file.
If your application uses some files with size set to *nomax, they should be suppressed from appearing on this report, and be printed separately. Use the Select Records feature of Query/400 to eliminate *nomax files.
MBSIZ NE 0
The most useful way to sort the report is in descending order by percent of capacity used. In this way, the files that are closest to capacity will print first on the report. Run the query to get a report of all files not set to *nomax and their percent of capacity used.
If you would like to be aware of files set to *nomax, create a second query, and use the select records feature in Query/400 to print only the *nomax files:
MBSIZ EQ 0
The AS/400 will provide information for only the files to which you have sufficient authority. You will need to ensure that you have enough authority to obtain information on all of the files in the library being analyzed.
It is unlikely that you will be able to have access to the QSECOFR password every time you want to check the capacity of your files.
It is preferable to create a command and command-processing program to adopt QSECOFR authority. Create a new command and command-processing program called, for instance, DSPFDALL. Have the security officer compile this new program with USRPRF(*OWNER) and make the owner QSECOFR.
When you use the command DSPFDALL, you will get information reported on all files in the requested library, but will not have permanent access to them or their contents.
Run these reports regularly, a few days before your major monthly processing begins. Review the reports and adjust file sizes as necessary before the processing starts.
Now, when you get a call from the system operator and the problem is that the file is full, youíll know there really is a problem. Iíll let you decide for yourself whether that is good or bad news!