Page 1 of 1

Reorganize spool file numbers in a job

Posted: Fri Oct 17, 2025 9:14 am
by peder udesen
I have an interesting little problem.

A job is running 24x7 and is generating spool files -- a lot of spool files.
The spool files are deleted after some time but the entry is still reserved.

That means that the spool file number increases over time and in about 3 months it will reach 9999 entries ( system limit )
and cause the job to crash.

Of course I could stop the job once a month and restart it, but I have thought about if it is possible to
"reorganize" the spooled files in the job moving the spool files still existing to the start ( with spool
file number starting with 1) and removing the deleted spool file entries from the system releasing the
spool file number.

Do you have any suggestions or good ideas.

Kind regards
Peder

Re: Reorganize spool file numbers in a job

Posted: Fri Oct 17, 2025 6:52 pm
by Scott Klement
I think all you'd have to do to "reorganize" is to end the job and start a new one. Perhaps you can do that once/month?

Alternately, you can consider whether you really need it to produce spooled files. Perhaps they can be eliminated? Or generated from a separate job?

My analysis here is simply that this process is poorly designed by someone who didn't realize the limitations. So all you should need to do is to fix these mistakes... i.e. make the design better.

Re: Reorganize spool file numbers in a job

Posted: Mon Oct 20, 2025 6:50 am
by peder udesen
Originally the program was part of an application that was run interactively.
Then it was changed to also be run in batch.
At that time the batch job was shut down every saturday when the backup was taken.

And now the backup process has changed so nothing is shut down any more but runs 24x7.
The purpose of the program is to generate the print.
But we didn't think of the problem with the deleted spool files.

Well, as I wrote, we might stop and start the job once a month.