IBM i message

CPF3141: Member not found

CPF3141 means the system found the database file, but the file has no member with the name the command asked for. The message gives the member name.

Other names for this code

Also written as CPF3141 member not found, MSGID CPF3141, member not found, CLRPFM CPF3141, MONMSG CPF3141.

What it means

CPF3141 is an escape message with the text "Member &2 not found." The Clear Physical File Member (CLRPFM) command lists it among its errors, and other commands that act on one named member can send it as well.

On IBM i a physical file is a container, and its records live in members inside it. Most data files have one member with the same name as the file. Source files and some work files have many, for example one member per month or per program. Commands that work on data take a file name and a member name. CPF3141 means the file lookup worked, so the library and the file are fine. Only the member was missing.

A file with no members at all is reported differently. CLRPFM sends CPF3133, "File &1 in library &3 contains no members." That usually means the file was created with CRTPF ... MBR(*NONE) and nobody added a member.

Common causes

  • The member name is wrong. Often a CL program builds it from a date, a user or a branch code, and the member for this period was never added.
  • A cleanup job removed the member with RMVM, or a monthly job that adds members didn't run.
  • The file was deleted and re-created, and the new copy has only its default member, or none.
  • The library list found a different copy of the file, in another library, that doesn't have this member. Test and production copies of the same file are the usual pair.
  • The member was renamed, for example to keep last month's data under a new name before the clear.

How to find the problem

  1. Run DSPJOBLOG, put the cursor on CPF3141 and press F1 to see the member name. The message before it shows the command and the file.
  2. List the members with DSPFD FILE(ACCTLIB/PAYMAST) TYPE(*MBRLIST). For a source file, WRKMBRPDM gives the same list with dates and text.
  3. Check which copy of the file the job used. WRKOBJ OBJ(*ALL/PAYMAST) OBJTYPE(*FILE) shows every library that holds a file of that name, and DSPLIBL shows the order the job searches them.
  4. In SQL, the catalog view QSYS2.SYSPARTITIONSTAT lists each member with its row count, which helps when a file has many members.

How to fix it

  • Correct the member name in the command or in the code that builds it.
  • If the member should exist, add it: ADDPFM FILE(ACCTLIB/PAYMAST) MBR(M202610).
  • In CL that may meet a missing member, check first. CHKOBJ OBJ(ACCTLIB/PAYMAST) OBJTYPE(*FILE) MBR(M202610) followed by MONMSG MSGID(CPF9815) EXEC(ADDPFM ...) adds the member only when it is missing.
  • If a missing member is normal for this step, monitor for it: MONMSG MSGID(CPF3141) right after the command.
  • Qualify the file with its library, or fix the library list, so the job always works on the copy you meant.

What it looks like

Member M202610 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(CPF3141) MSGF(QSYS/QCPFMSG)

Also inspect the full job log and second-level message text, including substitution values.

Report a correction to WND Software.

Questions

What is the difference between CPF3141 and CPF9815?

Both say a member is missing. CPF9815 is the general message that CHKOBJ and many other commands send, and its text also names the file and library. CPF3141 is the shorter message that member commands such as CLRPFM send.

I can see the file in WRKOBJPDM. Why is the member not found?

WRKOBJPDM lists objects, so it shows the file but not its members. Use DSPFD TYPE(*MBRLIST) or WRKMBRPDM to see the members, and check that the job's library list points at the same copy of the file you are looking at.

Can I clear a file without knowing the member name?

Yes. MBR(*FIRST) clears the first member, which for a single-member file is the only one. If the file has no members you get CPF3133 instead.