How to determine the file size of a a PF in AS/400. Is there a specific CL command which tells us as to how many records a file can store? Or how much more records it can accomodate before its 100% full?
The field ODOBSZ from the DSPOBJD command will give you the actual object size.
RTVMBRD FILE(YOURLIB/YOURFILE) NBRCURRCD(&NBRCURRCD)
NBRDLTRCD(&NBRDLTRCD)
returns the information about the number of records in one member to your CL program.
You shuld pay attention to the space taken by deleted records as they remain until you reorganize (RGZPFM).
DSPFD FILE(YOURLIB/YOURFILE) TYPE(*MBRLIST) OUTPUT(*OUTFILE)
OUTFILE(YOURLIB/DSPFDOUT)
gives you a table of information about all the members of a PF. The fields MLNRCD and
MLNDTR give you the corr. information that the RTVMBRD does.
There are APIs to get similar information, too.
Generally, if you set the SIZE option when you create the file (CRTPF) you shouldn't have problems of running out of room, though. The system should extend the space as necessary. We usually set the size at *NOMAX. This has worked for us for many years without problems.
Hi,
The only problem with setting your file sizes to *NOMAX is that if you have a program error where a program gets stuck in a loop writing to a file it can fill your disk up and bring the machine down.
If you've got a reasonably experienced development team this shouldn't be a problem.
Regards,
Martin Gilbert.
Discuss This Question: 2  Replies