CPA5305: Record not added, member is full
CPA5305 (Record not added. Member is full) means a job tried to add a record to a database file member that has reached its size limit. The job stops and waits for a reply before it adds the record or cancels.
Other names for this code
Also written as CPA5305 error, CPA5305 member is full, record not added member is full, CPA5305 (C I 9999), member full AS400, MSGID CPA5305.
What it means
Every physical file member on IBM i has a size limit set by the file's SIZE parameter. It holds three numbers, the initial number of records, the increment, and the maximum number of increments. When a member is full and a job tries to add another record, the system doesn't fail the write straight away. It sends CPA5305, an inquiry, and the job waits for a reply.
The message names the member and shows the replies it accepts, (C I 9999). C cancels the request. Replying I lets the member grow so the record can be added and the job carries on. The 9999 reply also lets the job continue, and its exact effect is described in the message help on your system. Press F1 on the message before choosing it.
In a batch job the inquiry goes to QSYSOPR, and the job sits in message wait until somebody answers. Many shops answer it automatically. That keeps jobs moving, but it also hides a file that is growing faster than anyone expected.
Common causes
- The file has grown normally until it reached its
SIZElimit. The default size for a new physical file is small for a busy history or log file. - Old records are never purged, so a log or history file grows without end.
- Deleted records still take space. Unless the file reuses deleted records, a file with many deletes fills up even though the active record count is small.
- A program is in a loop and writing the same records over and over.
- An IBM or vendor work file grew past its limit. IBM has a support document for this message on a service agent file, where the fix was to clear the files or set them to reuse deleted records.
How to find the problem
- Press F1 on the message to see the file, library and member. In a batch job, find the waiting message in QSYSOPR or with
WRKACTJOBand a job in MSGW status. - Run
DSPFD FILE(ACCTLIB/and look at the current number of records, the number of deleted records and the size settings.PAYHIST) TYPE(*MBR) - If the number of deleted records is high, the space is going to deleted records rather than real data.
- If the file grew much faster than usual, look at the job writing to it for a loop before you give it more room.
How to fix it
- Reply I to let the job add the record and finish, if the growth is expected. Reply C if the job looks like it is in a loop.
- Raise the limit with
CHGPF FILE(ACCTLIB/or with larger numbers. Forum users point out that *NOMAX also removes the safety stop for a runaway program, so many shops keep a high but finite limit.PAYHIST) SIZE(*NOMAX) - Reclaim deleted space with
RGZPFM, or setREUSEDLT(*YES)withCHGPFso new records reuse deleted slots. - Purge old records on a schedule, and clear work files (
CLRPFM) that nobody needs. - If you answer it automatically, use
ADDRPYLE MSGID(CPA5305) RPY(I)and run the jobs withINQMSGRPY(*SYSRPYL). Keep an eye on file sizes so a runaway job doesn't fill the disk.
What it looks like
Record not added. Member PAYHIST is full. (C I 9999)
IBM documentation
IBM Display Message Descriptions (DSPMSGD). Use the documentation for your installed release.
This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.
Read the installed message description:
DSPMSGD MSGID(CPA5305) MSGF(QSYS/QCPFMSG)
Also inspect the full job log and second-level message text, including substitution values.
Related codes
Questions
Is it safe to reply I to CPA5305?
Usually, if the file is expected to grow. Check first that the job isn't stuck in a loop, since each I lets it keep writing.
Should I set every file to SIZE(*NOMAX)?
Not without thought. A size limit stops a looping program before it fills the disk. Many shops set *NOMAX only on files that legitimately grow without bound.
Why is the member full when it has few records?
Deleted records still count toward the size until the file is reorganized or set to reuse deleted records. Check the deleted record count in DSPFD.