IBM i message

CPF3342: Job not found

CPF3342 means a command, usually one that works on spooled files, named a job that isn't on the system. The job name, user or number is wrong, or the job has ended and been removed along with its output.

Other names for this code

Also written as CPF3342 job not found, MSGID CPF3342, job not found IBM i, CPYSPLF CPF3342, MONMSG CPF3342.

What it means

CPF3342 is an escape message with the text "Job &5/&4/&3 not found." The values are the job number, the user and the job name, in the order IBM i always writes a qualified job name. Spooled file commands such as Copy Spooled File (CPYSPLF) list it among their errors, because they find a spooled file through the job that created it.

The command never gets as far as the spooled file. It looks up the job first, and if no job matches all three parts, it stops with CPF3342. Related messages from the same commands cover the next steps. CPF3343 means more than one job matched, CPF3303 means the job exists but has no spooled file by that name, and CPF3344 means the spooled file is no longer on the system.

A job stays on the system after it ends while it still has spooled output or a job log waiting. Once those are gone and the system cleans up, the job can't be found any more. Programs that act on spooled files some time after they were created often meet this.

Common causes

  • One part of the job name is wrong. The number, user or name was mistyped, or a CL program passed them in the wrong order. The JOB parameter takes them as number/user/name.
  • The job ended and its spooled files were printed or deleted, so the system removed the job. A program that saved the job name earlier, for example from a data queue entry, then refers to a job that is gone.
  • The job ran on another system. A job number from one partition means nothing on another.

How to find the problem

  1. Run DSPJOBLOG and press F1 on CPF3342 to see the job number, user and name the command looked for.
  2. Search for the job with WRKJOB JOB(052174/CLERK04/PAYRUN01), or list a user's jobs with WRKUSRJOB USER(CLERK04) STATUS(*ALL). WRKSBMJOB lists jobs you submitted.
  3. If the job should still have output, run WRKSPLF SELECT(CLERK04) to look for its spooled files under the user.
  4. In a CL program, display the variables passed to the JOB parameter in debug and check that the number, user and name are in the right order.

How to fix it

  • Correct the job name, user and number. Copy them from WRKSPLF or WRKUSRJOB rather than typing them.
  • In programs that process spooled files later, for example from a data queue on an output queue, add MONMSG MSGID(CPF3342 CPF3303 CPF3344) and skip entries for files that are already gone.
  • Run the command on the system where the job ran.
  • If you need the output to stay available, keep the spooled files on hold, or create them with SAVE(*YES) so they stay after printing, until the processing step has run.

What it looks like

Job 052174/CLERK04/PAYRUN01 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(CPF3342) MSGF(QSYS/QCPFMSG)

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

Report a correction to WND Software.

Questions

The job ran this morning. Why can't the system find it?

Once a job has ended and all its spooled files are gone, the system removes it. After that, any command that names the job gets CPF3342.

In what order do I give the job name?

Job number, then user, then job name, as in 052174/CLERK04/PAYRUN01. Commands such as CPYSPLF and WRKJOB take it in that form on the JOB parameter.

How is CPF3342 different from CPF3303?

CPF3342 means the job wasn't found at all. CPF3303 means the job exists but has no spooled file with the name and number given.