IBM Support

Program Stops after Creating 9999 Spooled Files

Troubleshooting


Problem

This document discusses an issue where a program stops with message CPF4167 "Job cannot create any more spooled files" after creating 9,999 spooled files.

Symptom

A program running on the AS/400 system stops after creating 9,999 spooled files. The job log shows that it is receiving the following message: CPF4167 - Job cannot create any more spooled files. The message cause states:

An attempt was made to create more than the maximum number (9,999) of spooled files for the job, or there is no room remaining in the job structure to create the file.

Is there a way to create more than 9,999 spooled files in a single job?

Cause

There is a limitation of 9,999 spooled files per job. However, support was added to V5R1M0 (R510) OS/400 to allow a job to create up to 999,999 spooled files after changing the QMAXSPLF (Maximum spooled files) system value. The QMAXSPLF system value defaults to a value of 9999. Therefore, a R510 iSeries system initially has the same limitation as AS/400 systems running earlier versions of OS/400. However, the QMAXSPLF system value can be set as high as 999,999.

Resolving The Problem

This issue can be resolved by using the Change System Value (CHGSYSVAL) command to set the QMAXSPLF (Maximum spooled files) system value to a higher value, such as 999999. For example:

CHGSYSVAL SYSVAL(QMAXSPLF) VALUE(999999)

Note: A change to the QMAXSPLF system value takes effect immediately; therefore, there is no need to IPL the system after making the change.





Although there is a limitation of 9,999 spooled files per job prior to R510 OS/400, the following options can be used to work around the limitation. Do one of the following:

oChange the program to keep a count of how many spooled files it has created. Then, have it start a copy of itself when it nears or reaches 9,999 spooled files or when message CPF4167 is received.
oChange the program to monitor for message CPF4167. Then, have it start a copy of itself whenever message CPF4167 is received.
oChange the program to use the Set Profile Handle (QWTSETP, QsySetProfileHandle) API to associate the job with another user profile.  This causes the spooled  files to be associated with a QPRTJOB job. The advantage of using the Set Profile Handle API is that the QPRTJOB which will automatically spawn itself when it reaches 9,999 spooled files. The disadvantage is that all of the resulting spooled files will be associated with the QPRTJOB job, rather than being associated with the original job.


References:
System API Reference, SC41-5801-03, Appendix A
OS/400 Printer Device Programming V4R4, SC41-5713-03

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

25864307

Document Information

Modified date:
18 December 2019

UID

nas8N1020460