f you already know what is using up disk space on your AS/400, and are sure
that your system has no garbage whatsoever on it, just turn the
page and go on to the next article in the newsletter. However,
if you wonder what is chewing up the disk space lately, and want
to know if there is anything you ought to clean up before spending
money (or begging for money) for new drives, keep reading.
Start by creating a file that has information about every object on the system. At first, it may seem unreasonable to create a big file of information, when the point of the exercise is to reduce DASD usage. However, it is likely that you will save a lot more space than you use when monitoring DASD usage.
Another advantage of gathering all of your object
information in one file is that you will then have the information
available for running a series of specific housekeeping reports.
Create this file in one of two ways. Use command DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*ALL) OUTFILE(mylib/myfile).
Alternatively, use GO DISKTASKS to get to the DISKTASKS
menu and then Option 1. Collect Disk Space Information
(RTVDSKINF) to collect information. The RTVDSKINF command will
output the information to file QAEZDISK in library QUSRSYS.
Both of the above commands will run for a long time, so run in batch, preferably off-hours. The first reason for running off-hours is obvious - to avoid annoying all the other system users and developers while you run a long tedious job.
The second reason for running in an off-hours time
slot is that you can get incomplete information if objects are
in use when you try to gather information on them.
For either RTVDSKINF or DSPOBJD, ensure that you have provided for sufficient authority to get all of the information you need. The AS/400 will give you information for only those objects to which you are authorized.
Commands that adopt authority can be helpful for
this purpose. For example, if you use the command DSPOBJD as
QPGMR, you will get only object descriptions that QPGMR is authorized
to see. So, create a command and command-processing program called,
for example, ALLOBJD. Have QSECOFR compile these new objects with
USRPRF(*OWNER). When you use the command ALLOBJD, you will get
object descriptions for all objects, without the inconvenience
of requiring QSECOFR to always submit the command, or the security
problem of giving QPGMR permanent authority to all objects.
Now that you have a file with information on every object, what you do to create reports depends on which way you gathered the information in the first place.
If you used the DISKTASKS menu, then you can use Option 2. Print Disk Space Information (PRTDSKINF) on the same menu. The PRTDSKINF command allows you to create custom reports by library, or by folder, or by object. It also allows some selection based on object or library size, to provide only the information that is most likely to be interesting.
If you used DSPOBJD to create the file of information
(or if you used RTVDSKINF, but want additional reports or a different
format than that available in PRTDSKINF) you can use query to
summarize by library, or to sort by size, or to select libraries
or objects of a certain size and print reports.
A small summary file can be handy for future reference.
If you create a summary file with one record per library to record
the library name and the total storage used by the library, you
will have the ability to do a quick comparison next week when
you re-run and summarize, and highlight the major changes immediately.
Unused objects information can be very helpful. In
both files (through DISKTASKS and DSPOBJD) the last change and
the last used dates for every object are provided. By comparing
those dates to your run date, you can determine if you have any
objects that may be obsolete, and therefore wasting disk space.
Now that you know where storage is being used unnecessarily,
and where the largest, most useless objects are located, all that's
left to do is to employ a little friendly persuasion, to encourage
those responsible to tidy up!