OS400 Move Spool File

Posted on 2007-10-16
Last Modified: 2013-12-06
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.
Question by:bmiller250
    LVL 26

    Expert Comment


    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.


    Author Comment

    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.
    LVL 26

    Accepted Solution


    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?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Title # Comments Views Activity
    Windows 7/OS X dual boot 10 53
    Windows 8.1 Netsh DHCP Server 2 57
    Applying quotas on system paritions 4 51
    Windows pro to home 2 54
    Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
    In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now