CPF3303: Spooled file not found in job
CPF3303 means a spooled file command, such as CPYSPLF, CHGSPLFA or DLTSPLF, couldn't find a spooled file with the name and number given in the job named. Often the file was never created, was already deleted, or belongs to a different job.
Other names for this code
Also written as CPF3303 file not found in job, MSGID CPF3303, spooled file not found, CPYSPLF CPF3303, CHGSPLFA CPF3303, MONMSG CPF3303.
What it means
CPF3303 is an escape message with the text "File &1 not found in job &5/
A spooled file is identified by its name, the job that created it and its number within that job. The commands take these as the FILE, JOB and SPLNBR parameters. JOB(*) means the job running the command. SPLNBR can be a number or a special value such as *ONLY or *LAST. If no spooled file in that job matches, the command ends with CPF3303 and does nothing.
The spooled file name is usually the name of the printer file the program used, such as QSYSPRT or QPRINT, unless an override gave it another name. A wrong guess at that name is a common cause.
Common causes
- The program didn't produce the report. It found no data and never opened the printer file, so there is nothing to copy. This is the classic cause when CPYSPLF follows a report program in a CL program.
- The command runs in a different job from the one that created the file, but uses JOB(*). For example, the report was created in a submitted job and the copy runs in the job that submitted it.
- The spooled file was already printed and removed, deleted by a user, or cleaned up by an output queue or job log cleanup routine.
- The name is wrong, for example the printer file name is used when an override gave the spooled file a different name.
- SPLNBR names a number the job doesn't have. If *ONLY is used and the job has several spooled files with that name, the command sends CPF3340 instead.
- The system clock was set back, for example for a daylight saving change. IBM documents that from V5R2 a spooled file created with a time earlier than its job's start time may not be found by CHGSPLFA, which then sends CPF3303 even though the file is visible.
How to find the problem
- Run DSPJOBLOG and press F1 on CPF3303 to see the file name and the full job name the command searched.
- Run
WRKSPLFfor the user, or WRKJOB for that job and take the spooled files option, to see which spooled files really exist and their names and numbers. - Check the program that should have created the file. Look for its printer file open in the job log, and check whether it had any data to print.
- Look for overrides (OVRPRTF) in the CL program that might rename the spooled file or send it to a different output queue.
How to fix it
- Pass the correct job, file name and number. Copy them from WRKSPLF or the job's spooled file list rather than guessing them.
- Make the report program always produce output, for example a page saying there was nothing to report, if later steps expect a file.
- Add
MONMSG MSGID(CPF3303)after the spooled file command and handle the missing file on purpose, such as sending a message to the operator. - Run the copy in the same job that created the file, or name that job explicitly on the JOB parameter.
- If the clock was set back, give the job name, file name and spooled file number explicitly on CHGSPLFA. IBM's advice is to end jobs that create spooled files before setting the clock back.
What it looks like
File QPRINT not found in job 052174/CLERK04/PAYRUN01.
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(CPF3303) MSGF(QSYS/QCPFMSG)
Also inspect the full job log and second-level message text, including substitution values.
Related codes
Questions
Why does CPYSPLF work in debug but fail in production?
The report program probably took a different path and printed nothing, so there was no spooled file to copy. Check whether the program opened its printer file at all in the failing run.
What is the difference between CPF3303 and CPF3342?
CPF3303 means the job was found but it has no spooled file with that name and number. CPF3342 means the job itself couldn't be found.
Can I ignore CPF3303?
Only if a missing report is a normal outcome. Add MONMSG for CPF3303 and decide in the program what should happen, rather than letting an inquiry message stop the job.