CPF9815: Member not found
CPF9815 means the file named on the command exists, but it doesn't contain a member with the name given. The message names the member, the file and the library.
Other names for this code
Also written as CPF9815 member not found, MSGID CPF9815, member not found IBM i, MONMSG CPF9815, CHKOBJ MBR CPF9815.
What it means
CPF9815 is an escape message from QCPFMSG. Its text reads "Member &5 file &2 in library &3 not found". On IBM i, the data in a physical file is kept in members. A file can have no members, one member, or many members up to its MAXMBRS limit. Source files work the same way, with one member for each piece of source.
The message means the system found the file and the library, so neither is missing. Only the member wasn't there. CHKOBJ with the MBR parameter is the classic place to see it, and other commands and system APIs that look up a member send it too.
CRTPF creates one member with the same name as the file unless told otherwise. A table created with SQL has one member, unless it is a partitioned table, which has one member per partition. So CPF9815 mostly turns up with files that are built to hold many members, or with files created with MBR(*NONE).
Common causes
- The member name is misspelled, or a variable built the wrong name, for example a member named after a date or a period.
- The step that adds the member (ADDPFM or ADDLFM) never ran, failed, or ran in a different order.
- Someone removed the member with RMVM, or a clean-up job removed old members.
- The file was created with MBR(*NONE), so it has no members at all.
- An override (OVRDBF with MBR) points the job at a member that isn't there.
How to find the problem
- Read the full message with DSPJOBLOG, cursor on CPF9815 and F1. It names the member, file and library exactly as the program used them.
- List the file's members with
DSPFD FILE(ACCTLIB/, or work with them in WRKMBRPDM.PAYHIST) TYPE(*MBRLIST) - Run DSPOVR to see whether an override in the job changed the member the program asked for.
- If the name came from a variable, look at the command just before the message in the job log. It shows the member name the program actually used.
How to fix it
- Correct the member name in the command, program or override.
- Add the member with
ADDPFM FILE(ACCTLIB/, or rerun the step that should have created it.PAYHIST) MBR(M202610) - Test for the member before using it. A common CL pattern runs CHKOBJ with OBJTYPE(*FILE) and MBR, then
MONMSG MSGID(CPF9815) EXEC(ADDPFM ...)to add it when it's missing. - If the file holds one member per period, check that MAXMBRS allows enough members, and that the clean-up job isn't removing members still in use.
What it looks like
Member M202610 file PAYHIST in library ACCTLIB not found.
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(CPF9815) MSGF(QSYS/QCPFMSG)
Also inspect the full job log and second-level message text, including substitution values.
Related codes
Questions
What is the difference between CPF9815 and CPF9812?
CPF9812 means the file itself wasn't found. CPF9815 means the file was found but didn't have the member named.
How do I list the members of a file on IBM i?
Use DSPFD with TYPE(*MBRLIST), or WRKMBRPDM for source files. Both show every member and when it was last changed.
Can an SQL table get CPF9815?
Rarely. An ordinary SQL table has one member, so only a wrong member name on a command that names one can cause it. Partitioned tables have one member per partition, so a wrong partition name can cause it too.