*NOMAX Does Not Mean Infinite Capacity
March 21, 2012 Hey, Ted:
The practice in our shop has been to set the initial size of physical files to what seems to be a reasonable value. In many cases, we leave the size at the default value of 10,000 records with three increments of 1,000 records each. Sometimes we change one or more of these values, usually the first one. Someone has suggested that we stop the guesswork and create all files with SIZE(*NOMAX). However, someone else is afraid that a program will go into a loop and fill up the disk space with output operations. Who’s right?
I agree with the first someone. There is no danger of filling up the disk space. *NOMAX does not mean that a file can contain an infinite number of records. Files have physical limits. You can find out more about those limits on IBM‘s web site.
If a program goes rogue, it will eventually run into one of these limits and the system will interrupt with the nasty error message CPF5272 (Failure for device or member &4 file &2 in library &3.).
I recommend that you change the default value of the SIZE parameter in the Create Physical File (CRTPF) command to *NOMAX. IBM tells you how to do that here.
I also recommend that you quit using DDS and start using SQL to define tables. SQL creates tables with SIZE(*NOMAX). But that may be more advice than you were asking for.