IBM i message

CPF9810: Library not found

CPF9810 means the library named on a command or in a program doesn't exist on the system, or the job can't see it. The message gives the library name.

Other names for this code

Also written as CPF9810 library not found, MSGID CPF9810, library not found IBM i, CPF9810E, MONMSG CPF9810.

What it means

CPF9810 is an escape message from QCPFMSG with the text "Library &1 not found". On IBM i, a library is itself an object, of type *LIB, and every library lives in the system library QSYS. When a command or program names a library explicitly, the system looks for it there. If no library of that name exists, it sends CPF9810.

This is different from CPF9801. With CPF9801 the library was fine and the object was missing. With CPF9810 the system never got as far as the object, because the library itself wasn't there.

A library can exist and still be invisible to a job. Libraries in an independent ASP can only be seen by jobs that have that ASP group set. To such a job the library looks missing, and it gets CPF9810.

Common causes

  • The library name is misspelled in the command, the program, a data area or a parameter passed in.
  • The library hasn't been created or restored on this system yet. This is common after moving to a new system, at a disaster recovery test, or when a program written on a test system runs in production.
  • The library was renamed or deleted, and a program, job description or override still uses the old name.
  • The library is in an independent ASP that is varied off, or the job hasn't set its ASP group with SETASPGRP.

How to find the problem

  1. Open the job log with DSPJOBLOG, put the cursor on CPF9810 and press F1. The help names the library. F9 shows the program and statement that hit it.
  2. Check whether the library exists with DSPOBJD OBJ(QSYS/ACCTLIB) OBJTYPE(*LIB), or list similar names with WRKLIB LIB(ACCT*).
  3. Look at the command just before the message in the job log. That shows exactly how the library was spelled when the program ran, which helps when the name came from a variable.
  4. For a library in an independent ASP, check that the ASP device is available (WRKCFGSTS CFGTYPE(*DEV)) and that the job set its ASP group.

How to fix it

  • Correct the library name in the command, program, data area or job description.
  • Create the library with CRTLIB, or restore it with RSTLIB, if it should exist on this system.
  • If the library was renamed on purpose, update every program, job description and scheduled job that still uses the old name.
  • Vary on the independent ASP and run SETASPGRP in the job before it uses the library.
  • In a CL program that can live without the library, monitor for the message with MONMSG MSGID(CPF9810) and handle it.

What it looks like

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(CPF9810) 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 CPF9810 and CPF2110?

Both mean the library doesn't exist. CPF2110 is sent by library and object commands such as ADDLIBLE, CHGLIBL and CRTDUPOBJ, and CPF9810 by many others, such as CHKOBJ.

The library exists. Why do I still get CPF9810?

Check the exact spelling the program used, as shown in the job log. If it is spelled right, the library is probably in an independent ASP that the job hasn't attached with SETASPGRP.

Does adding the library to my library list fix CPF9810?

No. You can't add a library that doesn't exist. CPF9810 is about the library being missing, not about the library list.