IBM i message

CPF3781: Library not found

CPF3781 means a save command such as SAVLIB was told to save a library that the system couldn't find. The message names the library, and nothing is saved from it.

Other names for this code

Also written as CPF3781 library not found, MSGID CPF3781, SAVLIB CPF3781, library not found save, MONMSG CPF3781.

What it means

CPF3781 has the text "Library &1 not found." Save Library (SAVLIB) lists it among its escape messages. It means a library named on the LIB parameter doesn't exist, or doesn't exist anywhere the job can see.

Libraries are objects of type *LIB, and all of them are described in QSYS. A save doesn't use the library list. It looks up each library by name. Libraries in an independent ASP are only visible to a job that is using that ASP group, or to a save that names the ASP device on its ASPDEV parameter.

The message most often shows up in old backup lists. A library was deleted or renamed months ago, but a CL program, a BRMS control group or a scheduled job still names it. Most commands report a missing library with CPF9810. CPF3781 is the version the save commands use. On the restore side, a library that isn't on the media gives a different message, CPF3780.

Common causes

  • The library was deleted or renamed, and a backup CL program, BRMS control group or job scheduler entry still names it.
  • The library name is mistyped on the command.
  • The library is in an independent ASP that is varied off, or the save job isn't attached to that ASP group and didn't name it on ASPDEV.
  • The library exists on another partition or system, and the backup list was copied from there.
  • A library that a job creates during the day, such as a work library, didn't get created before the backup ran.

How to find the problem

  1. Run DSPJOBLOG on the save job and press F1 on CPF3781 to see the library name.
  2. Check whether the library exists: DSPOBJD OBJ(QSYS/ACCTLIB) OBJTYPE(*LIB). If it reports that the object isn't found, the library is gone from the system ASP and any basic user ASPs.
  3. Search your backup lists for the name. Look in the backup CL source, in BRMS control groups with WRKCTLGBRM, and in job scheduler entries with WRKJOBSCDE.
  4. For independent ASPs, check that the ASP device is available with WRKCFGSTS CFGTYPE(*DEV) CFGD(*ASP), and check the save command's ASPDEV value.
  5. When several libraries were named, look also for the summary message at the end of the save, such as CPF3777, which counts libraries saved, partly saved and not saved.

How to fix it

  • Remove the library from the CL program, BRMS control group or schedule if it no longer exists.
  • Correct the name if it was mistyped.
  • For an independent ASP, vary it on, and either run SETASPGRP in the save job or name the device on the ASPDEV parameter.
  • If the library is optional, for example a work library that may not exist that night, add MONMSG MSGID(CPF3781) after that save so the rest of the backup runs.
  • Save generic groups such as LIB(*ALLUSR) when you want every user library, so deleted libraries simply drop out of the backup.

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

Both mean a library wasn't found. CPF3781 is the version the save commands send, and CPF9810 is the general message most other commands use.

Does CPF3781 stop the rest of my backup?

It can. It is an escape message, so a CL program that doesn't monitor for it ends at that command. Add MONMSG for it or fix the library list in the backup.

The library exists. Why does the save still say it isn't found?

The library is probably in an independent ASP the save job can't see. Name the ASP device on ASPDEV or run SETASPGRP in the job first.