ibm-midrangedb2-400

Number or *NOMAX value in AS400/DB2 table compilation


In AS400, there are some default values at table (QDDSSRC) compilation (Opt 14). In the attribute Member Size, Additional parameters:

Which is the meaning of put a number or *NOMAX value, and if this number is a limit of records or is just a physical size increment.

case 1: Member size Initial number of records ______ 100000

case 2: Member size Initial number of records ______ *NOMAX


Solution

  • Mike gave the short answer to this question, so here is the long answer.

    This configuration is a holdout from the old days of limited disk space. Some still like to use it though to prevent runaway jobs from filling up their disk. If the disk gets too full, the system shuts down. There are several related configuration parameters, ALLOCATE and REUSEDLT.

    Here is how the SIZE attribute works. It has three parts: initial number of records, increment number of records, and maximum number of increments. When a member is added to a physical file (or a source physical file), the initial number of records is allocated for that file. Depending on the ALLOCATE attribute, it might be physically allocated, or soft allocated. In any case, the file can now hold that many records. For a source file like QDDSSRC this defaults to 10,000 (that would be 10,000 lines of source). If a program wants to write more records, more space is added in increments. The increment number of records determines how many records to add to the file. This can happen a specified maximum number of increments times. A source file defaults to 499 increments of 1,000 records, so a full source file member defaults to 509,000 records. That is 10,000 + (499 * 1,000). Once a file member is full, any attempt to add a record will cause a message to be placed on the system operators queue requesting permission to increase the file size.

    Note that this means a file member can hold more than the record capacity number of records, but manual intervention by the system operator is required for this to happen.

    DDS tables default this to 10,000 initial records and 3 increments of 1,000 records. SQL tables (those defined using DDL) defaults this to *NOMAX. *NOMAX means that the maximum number of records in the table is determined by the system. This might be limited by disk space, or an absolute maximum imposed by the database.

    DB Limits As of v7.3

    Maximum rows in a member          4,294,967,288
    Maximum size of a member          1.7 terabytes
    

    One of the reasons SQL can get away with using *NOMAX is that it reuses space occupied by deleted records by default. DDS defined files do not do that (unles the user changes the default). So for a DDS table, each write causes another record to be used up. This can cause the file to fill up with deleted records, mandating manual intervention to reclaim that space. The current wisdom is to use SIZE(*NOMAX), ALLOCATE(*NO) and REUSEDLT(*YES). This, once and for all, lets the system decide how to allocate disk space. You can get this behavior for DDS defined files by changing the command defaults for CRTPF.