Troubleshooting
Problem
This document provides information on issues where a writer is accidentally changed to refer to another output queue.
Resolving The Problem
Occasionally, a printer writer becomes associated with another output queue (for example, the QPRINT output queue). Therefore, the printer writer then prints several spooled files that were not intended to be printed. Ending and restarting the writer gets the printer writer to be associated with the proper output queue (the output queue with the same name as the printer device description, and that is in the QUSRSYS library). This document explains a way that this can occur accidentally.
Note: The Change Writer (CHGWTR) command, or selecting option 2 (Change) from the Work with Writers (WRKWTR) command, can be used to deliberately change a printer writer to point to an output queue other than the one associated with the printer device description. However, this document discusses a way that this can occur that is not deliberate (and that is fairly easy for a novice user to do).
This document was last updated on 23 July 2014.
-
Accidentally Changing the Writer using Option 9 (Work with Printing Status)
This situation is most likely caused by using Option 9 (Work with printing status) from the Work with Output Queue (WRKOUTQ) or Work with Spooled Files (WRKSPLF) commands to get a spooled file moved to a printer or output queue rather than using Option 2 (Change) to change the Printer (DEV) or Output queue (OUTQ) parameters to point to the desired printer or output queue.
For example, this can be done by taking the following steps:1. Use the Work with Output Queue (WRKOUTQ) command on an output queue that is not associated with a writer, or use the Work with Spooled Files (WRKSPLF) command to work with the spooled files associated with your user profile. 2. Take Option 9 (Work with printing status) on one of the spooled files that is in RDY (Ready) status. Then, press the Enter key. Work with Output Queue
Queue: QPRINT Library: QUSRSYS Status: RLS
Type options, press Enter.
1=Send 2=Change 3=Hold 4=Delete 5=Display 6=Release 7=Messages
8=Attributes 9=Work with printing status
Opt File User User Data Sts Pages Copies Form Type Pty
9 QPJOBLOG QUSER QGYSERVER RDY 1 1 *STD 5
_ QPJOBLOG RYG QPADEV001W RDY 3 1 *STD 5
_ QPJOBLOG RYG QPADEV001V RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QZDASOINIT RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QZDASOINIT RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QPADEV002B RDY 6 1 *STD 5
_ QPJOBLOG RAM68 QZDASOINIT RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QPADEV000G RDY 1263 1 *STD 5
_ QPJOBLOG QUSER QZDASOINIT RDY 4 1 *STD 5
More...
Parameters for options 1, 2, 3 or command
===>
F3=Exit F11=View 2 F12=Cancel F20=Writers F22=Printers
F24=More keys3. The Work with Printing Status screen is shown. The Status Description should state This file is not associated with a started printer. Therefore, select Option 2 (Change status) to change the status of this spooled file, and press the Enter key. Work with Printing Status
Job . . . . . . . . : QGYSERVER File . . . . . . . . : QPJOBLOG
User . . . . . . . : QUSER Number . . . . . . : 1
Number . . . . . . : 906789 User data . . . . . : QGYSERVER
Job system name . . : RCHASSQ1 Creation date . . . : 01112007
Creation time . . . : 171334
Type options, press Enter.
2=Change status 5=Display detailed description
Opt Status Description
2 This file is not associated with a started printer.
Bottom
Command
===>
F3=Exit F4=Prompt F5=Refresh F9=Retrieve F12=Cancel4 The Change Status screen is shown. Type the name of a printer where it says Printer to print the file, and press the Enter key. Work with Printing Status
Job . . . . . . . . : QGYSERVER File . . . . . . . . : QPJOBLOG
User . . . . . . . : QUSER Number . . . . . . : 1
Number . . . . . . : 906789 User data . . . . . : QGYSERVER
Job system name . . : RCHASSQ1 Creation date . . . : 01112007
Creation time . . . : 171334
Type options, press Enter.
2=Change status 5=Display detailed description
..........................................................................
Opt : Change Status :
2 : :
: Type choice, press Enter. :
: :
: Printer to print the file . . . . . PRT01 Name, F4=List :
: :
: :
: :
: :
Com : :
=== : F4=Prompt F6=Display details F12=Cancel :
F3= : :
:........................................................................:5a. A new Change Status screen is shown. If the writer for the printer you specified is not yet started, you are given the following choices:
1. Move file to output queue of printer writer and start it.
2. Start printer writer to output queue of file.Work with Printing Status
Jo ...........................................................................
: Change Status :
: :
Jo : Printer . . . . . . . . . . . . . . . . . . . . . . : PRT01 :
: :
: Output queue of file . . . . . . . . . . . . . . . . : QPRINT :
Ty : Library . . . . . . . . . . . . . . . . . . . . . : QGPL :
: Bottom :
: Select one of the following: :
Op : :
2 : 1. Move file to output queue of printer and start it :
: 2. Start printer writer to output queue of file :
: :
: :
: :
: :
: Selection :
: :
Co : :
== : F12=Cancel :
F3 : :
:.........................................................................:
If Option 1 (Move file to output queue of printer and start it) is selected, the spooled file is moved to the output queue associated with the printer specified in Step 4, and the writer for that printer will be started, if needed. For example, the spooled file will be moved from the QPRINT output queue to the PRT01 output queue. Then, the PRT01 writer is started with the Output queue (OUTQ) parameter set to PRT01. Therefore, the writer is started with its own output queue.
If Option 2 (Start printer writer to output queue of file) is selected, the writer for that printer (for example, PRT01) is started with the Output queue (OUTQ) parameter set to the name of the output queue where the spooled file currently resides. For example, the PRT01 printer writer will be started with the Output queue (OUTQ) parameter set to QPRINT causing all spooled files in the QPRINT library that are in RDY (Ready) status to be printed through the PRT01 printer writer.5b. If the writer for the printer you specified is already started, you are provided the following options:
1. Move file to output queue of printer writer.
2. Change printer writer to use output queue of file.Work with Printing Status
Jo ...........................................................................
: Change Status :
: :
Jo : Printer . . . . . . . . . . . . . . . . . . . . . . : IP1140 :
: Output queue of printer writer . . . . . . . . . . . : IP1140 :
: Library . . . . . . . . . . . . . . . . . . . . . : QUSRSYS :
Ty : Output queue of file . . . . . . . . . . . . . . . . : QPRINT :
: Library . . . . . . . . . . . . . . . . . . . . . : QGPL :
: Bottom :
Op : Select one of the following: :
2 : :
: 1. Move file to output queue of printer writer :
: 2. Change printer writer to use output queue of file :
: :
: :
: :
: Selection :
: :
Co : :
== : F12=Cancel :
F3 : :
:.........................................................................:
If Option 1 (Move file to output queue of printer writer) is selected, the spooled file is moved to the output queue associated with the printer writer. For example, the spooled file will be moved from the QPRINT output queue to the PRT01 output queue. Therefore, the spooled file is printed through the PRT01 printer writer.
If Option 2 (Change printer writer to use output queue of file) is selected, the writer for that printer (for example PRT01) is changed to set the Output queue (OUTQ) parameter to the name of the output queue where the spooled file currently resides. For example, the PRT01 printer writer is changed to set the Output queue (OUTQ) parameter to QPRINT causing all spooled files in the QPRINT library that are in RDY (Ready) status to be printed through the PRT01 printer writer.
-
Moving Spooled Files Using Option 2 (Change) or Change Spooled File Attributes (CHGSPLFA) Command
One way to avoid the previous situation is to select Option 2 (Change) on the spooled file and specifying the printer name in the Printer (DEV) parameter or the Output queue (OUTQ) parameter rather than selecting Option 9 (Work with printing status). This can be done by doing the following:1. Use the Work with Output Queue (WRKOUTQ) command on an output queue that is not associated with a writer, or use the Work with Spooled Files (WRKSPLF) command to work with the spooled files associated with your user profile. 2. Select Option 2 (Change) on one of the spooled files that is in RDY (Ready) status, and press the Enter key. Work with Output Queue
Queue: QPRINT Library: QUSRSYS Status: RLS
Type options, press Enter.
1=Send 2=Change 3=Hold 4=Delete 5=Display 6=Release 7=Messages
8=Attributes 9=Work with printing status
Opt File User User Data Sts Pages Copies Form Type Pty
2 QPJOBLOG QUSER QGYSERVER RDY 1 1 *STD 5
_ QPJOBLOG RYG QPADEV001W RDY 3 1 *STD 5
_ QPJOBLOG RYG QPADEV001V RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QZDASOINIT RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QZDASOINIT RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QPADEV002B RDY 6 1 *STD 5
_ QPJOBLOG RAM68 QZDASOINIT RDY 2 1 *STD 5
_ QPJOBLOG RAM68 QPADEV000G RDY 1263 1 *STD 5
_ QPJOBLOG QUSER QZDASOINIT RDY 4 1 *STD 5
More...
Parameters for options 1, 2, 3 or command
===>
F3=Exit F11=View 2 F12=Cancel F20=Writers F22=Printers
F24=More keys3. This prompts the Change Spooled File Attributes (CHGSPLFA) command. The Printer (DEV) parameter is typically set to *OUTQ. If you press the Page Down key, you will see that the Output queue (OUTQ) parameter is set to the name of the output queue where the spooled file currently resides. Change Spooled File Attributes (CHGSPLFA)
Type choices, press Enter.
Spooled file . . . . . . . . . . > QPJOBLOG Name, *SELECT
Job name . . . . . . . . . . . . > QGYSERVER Name, *
User . . . . . . . . . . . . . > QUSER Name
Number . . . . . . . . . . . . > 906789 000000-999999
Spooled file number . . . . . . > 1 1-999999, *ONLY, *LAST, *ANY
Job system name . . . . . . . . > RCHASSQ1 Name, *ONLY, *CURRENT, *ANY
Spooled file created:
Creation date . . . . . . . . > 01112007 Date, *ONLY, *LAST
Creation time . . . . . . . . > 171334 Time, *ONLY, *LAST
Printer . . . . . . . . . . . . *OUTQ Name, *SAME, *OUTQ
Print sequence . . . . . . . . . *SAME *SAME, *NEXT
Form type . . . . . . . . . . . *STD Form type, *SAME, *STD
Copies . . . . . . . . . . . . . 1 1-255, *SAME
Restart printing . . . . . . . . *STRPAGE Number, *SAME, *STRPAGE...
More...
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys4a. Type the name of the printer in the Printer (DEV) parameter. Or, proceed with Step 4b. Change Spooled File Attributes (CHGSPLFA)
Type choices, press Enter.
Spooled file . . . . . . . . . . > QPJOBLOG Name, *SELECT
Job name . . . . . . . . . . . . > QGYSERVER Name, *
User . . . . . . . . . . . . . > QUSER Name
Number . . . . . . . . . . . . > 906789 000000-999999
Spooled file number . . . . . . > 1 1-999999, *ONLY, *LAST, *ANY
Job system name . . . . . . . . > RCHASSQ1 Name, *ONLY, *CURRENT, *ANY
Spooled file created:
Creation date . . . . . . . . > 01112007 Date, *ONLY, *LAST
Creation time . . . . . . . . > 171334 Time, *ONLY, *LAST
Printer . . . . . . . . . . . . PRT01 Name, *SAME, *OUTQ
Print sequence . . . . . . . . . *SAME *SAME, *NEXT
Form type . . . . . . . . . . . *STD Form type, *SAME, *STD
Copies . . . . . . . . . . . . . 1 1-255, *SAME
Restart printing . . . . . . . . *STRPAGE Number, *SAME, *STRPAGE...
More...
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys4b Press the Page Down key, and type the name of the output queue associated and the output queue library in the Output queue (OUTQ) parameter. Change Spooled File Attributes (CHGSPLFA)
Type choices, press Enter.
Additional Parameters
Output queue . . . . . . . . . . PRT01 Name, *SAME, *DEV
Library . . . . . . . . . . . QUSRSYS Name, *LIBL, *CURLIB
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Notes:5. Press the Enter key to change the spooled file attributes so that the spooled file is moved to the new printer device description or the new output queue. o If using a Remote Output Queue (RMTOUTQ) that is not associated with a dummy device description (if there is no printer device description with the same name as the RMTOUTQ), the Output queue (OUTQ) parameter must be changed. Changing the Printer (DEV) parameter in this case results in the following message: CPF3347 - Device PRT01 not found. o If the Output queue (OUTQ) parameter is changed but the output queue library is not set to the correct library for the new output queue (or to *LIBL if the new library is in the library list), the result is the following message being issued: CPF3410 - New output queue PRT01 in QGPL not found.
-
Granting *EXCLUDE Authority to the CHGWTR Command
Another option is to use the Grant Object Authority (GRTOBJAUT) command to grant *EXCLUDE authority to the Change Writer (CHGWTR) command for certain users and granting *USE authority for other users. For example:
GRTOBJAUT OBJ(QSYS/CHGWTR) OBJTYPE(*CMD)
USER(*PUBLIC) AUT(*EXCLUDE)
GRTOBJAUT OBJ(QSYS/CHGWTR) OBJTYPE(*CMD)
USER(QSECOFR QSYSOPR) AUT(*USE)
If a user is not authorized to the CHGWTR command, then taking Option 9 (Work with printing status) and then Option 2 (Change printer writer to use output queue of file) will result in messages CPD0032 "Not authorized to command CHGWTR in library *SYSTEM" and CPF0001 "Error found on CHGWTR command". This is not a very elegant solution, but would effectively prevent the writer from printing all of the spooled files that are in Ready (RDY) status in a user's output queue because they used Option 9 (Work with printing status) instead of Option 2 (Change).
Note: Granting users *EXCLUDE authority to the CHGWTR command will have no affect if the user profile, or a group profile associated with the user profile, has *ALLOBJ special authority.
-
Determining Which User Profile Caused the Writer Job to Change
When the writer job is changed to point to another output queue through the use of Option 9 (Work with printing status), the change is made under-the-covers using the Change Writer (CHGWTR) command. Therefore, object auditing can be used to determine which job caused the writer to be changed, provided that QAUDCTL (Auditing control) system value already specifies *OBJAUD and object auditing has been setup on the QSYS/CHGWTR command.
If object auditing is not already setup on the QSYS/CHGWTR command; however, it is likely that this issue will occur again, then you can set up object auditing using the instructions in the following Rochester Support Center knowledgebase document:
N1018707: Using Object Auditing to Track Use of Print-Related Commands
making certain that you set up object auditing specifically on the CHGWTR command using the Change Object Auditing (CHGOBJAUD) command, for example:
CHGOBJAUD OBJ(QSYS/CHGWTR) OBJTYPE(*CMD) OBJAUD(*ALL)
and the wait for the problem to occur again.
Once you have found an instance where the writer has changed to point to a different output queue, use the Display Audit Journal Entry (DSPAUDJRNE) or the Display Journal (DSPJRN) command to write any command string (CD) journal entries to a spooled file, then look for "CD" journal entries for the CHGWTR command to see which jobs used the CHGWTR command.
For example, the audit journal entries may show something like the following:
CD C V2KEA261 CHGWTR *NLVLIBL N QPADEV001P V2KEA261 649051 2010-06-01-14.30.33.665264
*NLVLIBL/CHGWTR WTR(PRT05) OUTQ(QUSRSYS/QEZJOBLOG)
CD C V2KEA261 CHGWTR *NLVLIBL N QPADEV001P V2KEA261 649051 2010-06-01-14.30.51.349520
*NLVLIBL/CHGWTR WTR(PRT01) OUTQ(QUSRSYS/QPRINT)
-
Other Suggestions to Prevent Spooled Files from Accidentally Printing
Other suggestions to prevent spooled files from accidentally printing include generating spooled files in HLD (Held) status when they are not expected to be printed, and holding output queues that are not intended for printing.
Generating Spooled Files in HLD (Held) Status
The most common example of generating spooled files that are not intended to be printed is system output, including job logs, service dumps and program dumps that are generated using system-supplied printer files. If the Change Printer File (CHGPRTF) command is used to change these printer files to set the Hold spooled file (HOLD) parameter *YES, for example:
CHGPRTF FILE(QSYS/QPJOBLOG) HOLD(*YES)
CHGPRTF FILE(QSYS/QPSRVDMP) HOLD(*YES)
CHGPRTF FILE(QSYS/QPDSPJOB) HOLD(*YES)
CHGPRTF FILE(QSYS/QPCSMPRT) HOLD(*YES)
CHGPRTF FILE(QSYS/QPPGMDMP) HOLD(*YES)
then the resulting spooled files will have to be released before they can be printed, which greatly reduces the likelihood that they will be printed accidentally.
Note that this can also be done with other printer files, or when using the Override with Printer File (OVRPRTF) command interactively or in a CL program.
Holding Output Queues not Intended for Printing
Generating spooled files in HLD status can prevent them from accidentally printing, but holding output queues that are not intended for printing also can prevent spooled files from accdentally printing. Those most common output queues that are used to store but not print spooled files include QPRINT, QEZJOBLOG and QEZDEBUG, which can be held using the following Hold Output Queue (HLDOUTQ) commands:
HLDOUTQ OUTQ(QGPL/PRINT)
HLDOUTQ OUTQ(QUSRSYS/QEZJOBLOG)
HLDOUTQ OUTQ(QUSRSYS/QEZDEBUG)
but if you also setup a printer and output queue called PRT01, but do not actually have these associated with a printer, then you can put this output queue on hold as well. For example:
HLDOUTQ OUTQ(QUSRSYS/PRT01)
Historical Number
29932713
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1019308