OS400 Move Spool File

OS400 5.3

We have a System i520 and would like to know if there is a way to copy spool files from one outq to another using one command.  We are all well aware of the slow method.
Who is Participating?
tliottaConnect With a Mentor Commented:

A little trickier... In this case, the problem involves a printer file -- QPJOBLOG -- that is (1) potentially used by every job in the system and (2) doesn't exist until the job finishes.

You don't want to change QPJOBLOG due to (1). And (2) means you can't effectively have the job do its own joblog routing because it doesn't exist while the program is still running; an OVRPRTF won't still be in effect when it's needed.

One possibility is to have the CL do a SBMJOB to execute a CHGSPLFA command against FILE(QPJOBLOG) JOB(thisjob) OUTQ(newoutq). The SBMJOB would submit the second job to the same jobq as the SAVLIB job. If that jobq is single-threaded so that only one job can run at a time, then the spooled joblog attributes won't be changed until after the SAVLIB job completes.


If the SAVLIB job is run through the job scheduler (and the jobq is single-threaded), then the second job can also be scheduled to be submitted a minute later than the first job. The second job would need to be more complex because it would need to determine the name of the SAVLIB job in order to know which QPJOBLOG file to move. If only one SAVLIB job exists, then this can be easy; but it could be tripped up at any time, especially if the joblog spooled file isn't deleted after it's printed.


The current SAVLIB job could be replaced by CL that (1) submitted the SAVLIB and then (2) submitted the CHGSPLFA job. This allows the possibility of the controlling job to receive the name of the SAVLIB job from the CPC1221 message that it gets when the first SBMJOB command is executed.

Or... well, various possibilities.

Any general preference on technique? Any details you need considered?


It's not clear if you're looking for a general way to do this that could be used in a CL program or you want to do this regularly from any outq to any other outq or you have a large number of spooled files that you want to move to another outq on a one-time basis or ...?

One suggestion to start, bring up the list of spooled files in the source outq with WRKOUTQ MYOUTQ. Then type '2' next to every spooled file you want to move. When you've scrolled through the list and have '2' next to every one you want, tab to the command line, type OUTQ(YOUROUTQ) and press [Enter]. Each spooled file on MYOUTQ will be moved to YOUROUTQ. Use whatever outq names are appropriate.

Alternatively, use iSeries Navigator to present a list of spooled files. Select all of the ones you're interested in. Choose 'Move...' from the right-click context menu of the selected ones. Type the name of the destination outq in the dialog that appears.

bmiller250Author Commented:
We have a CL program that performs a SAVLIB; called every night at 11:30 PM.  And every morning i have to type '2' next to the job log and redirect it to the laser printer.  My boss wants me to keep paper backup logs.  We would like to job log to print every night after the has backup finished.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.