Troubleshooting
Problem
This document discusses issues with print or remote writers not successfully starting after an IPL.
Symptom
Print or remote writers do not successfully start after an IPL or system backup or save.
The writer can be manually started using the STRPRTWTR command for print writers or STRRMTWTR command for remote writers.
For print writers, these messages might be seen in QSYSOPR or the writer's message queue:
Message CPA3387: Device <PrinterDeviceName> not available. (C R)
Answering CPA3387 with R for Retry after the system is started will typically start the print writer.
Message CPD338A: Cannot resolve to remote device name <Name-Or-IP Address>.
This message indicates that TCP/IP is not completely started by the time the remote or print writers attempt to start.
For either print or remote writers, this message might be seen in the QSTRUPJD job log:
Message CPF3348: Spooling subsystem is not active.
This occurs when print or remote writers attempt to start before QSPL subsystem is completely started.
Cause
A timing issue with the printer device not being varied on before QWCSWTRS program completes or TCP/IP not being completely started before remote and print writers attempt to start.
Environment
Any release of the OS.
The timing issue appears to be more prevalent at higher releases as IPL times become quicker.
Resolving The Problem
The most common reason for writers not starting after a system IPL is timing. TCP/IP is not fully started before remote or print writers attempt to start. Or, QSPL subsystem is not completely started before the writers attempt to start.
Other causes include:
- The printer device is not varied on before the QWCSWTRS program completes or before a STRPRTWTR command is issued.
- The Writers to Autostart (AUTOSTRWTR) parameter in the output queue description for the printer device or remote output queue is set to *NONE.
If the issue with writers started after an upgrade, review Print Writers May Not Start at OS V7R4 or V7R5 After IPL or with STRPRTWTR DEV(*ALL) Command
Explanation of default environment:
The most current IBM-supplied startup program starts QSPL later in the program. Earlier versions of the startup program start QSPL at the beginning of the program.
QSPL subsystem has an autostart job entry named QSTRRMTWTR to start remote writers.
After QSPL subsystem starts, QWCSWTRS program is called to start a print writer for printer devices that are in varied on status.
Before remote or print writers start, it is necessary for TCP/IP to be completely started too as in today's environment, majority of printers are LAN attached. The IPL attributes include an option to Start TCP/IP which defaults to YES, though some may include the STRTCP command in the startup program. Either way, TCP/IP must be started for print and remote writers for LAN-attached printers to successfully start.
Additionally, it is important for remote writers to start before print writers. Why? Some remote output queues may have a 'dummy' printer device description used for spooled file routing purposes. If the dummy printer device for the remote output queue has the Online at IPL (ONLINE) parameter set to *YES, the printer device may vary on and a print writer may attempt to start before the remote writer. Ensure the ONLINE parameter is set to *NO for the dummy printer device descriptions:
VRYCFG CFGOBJ(DummyDeviceName) CFGTYPE(*DEV) STATUS(*OFF)
CHGDEVPRT DEVD(DummyDeviceName) ONLINE(*NO)
If there are spooled files ready to print at the time the writer attempts to start and TCP/IP is not completely started, the writer will likely end abnormally. Messages that might be seen in the history log:
CPF3382: Writer &3/&2/&1 started.
CPF3397: Writer &3/&2/&1 did not end normally.
In this default environment, remote and printer writers for network printers should be started automatically after an IPL, or after completing a backup or system save.
To diagnose why writers are not starting after an IPL, gather and review:
1) The start up joblog
WRKJOB JOB(QSTRUPJD)
Select option 4. Work with spooled files to locate the joblog
2) The history log covering an hour before and after the IPL
**NOTE: Adjust the time and date format as needed to match the system
DSPLOG PERIOD(('hh:mm:ss' 'DD/MM/YYYY') ('hh:mm:ss' 'DD/MM/YYYY')) OUTPUT(*PRINT)
3) The start up program source
DSPSYSVAL SYSVAL(QSTRUPPGM)
Note the Startup program name and Library
DSPOBJD OBJ(LibraryName/StartupPgmName) OBJTYPE(*PGM) DETAIL(*SERVICE)
Note the Source file, Library and Member names
WRKMBRPDM FILE(LibraryName/SourceFileName) MBR(MemberName)
Select option 6=Print next to the member
Identify which writer(s) are not starting.
For one or two of the writers that are not starting, collect the printer device and output queue descriptions:
DSPDEVD DEVD(DeviceName) OUTPUT(*PRINT)
WRKOUTQD OUTQ(LibraryName/OutQName) OUTPUT(*PRINT)
Look for error messages in the QSTRUPJD job log about QSPL subsystem or writers starting or ending.
Look in the history log for messages about the writer starting and possibly ending abnormally and if TCP/IP is completely started before writers attempt to start. A message about LOOPBACK being started is a good indication that TCP/IP is completely started; TCP8A3E: Interface 127.0.0.1 is active.
Look at the startup program source and see when QSPL subsystem is being started at the beginning or end of the program, if the program is starting TCP/IP, if there are any delays before starting QSPL subsystem or if the QWCSWTRS program is being called to start print writers or if the STRPRTWTR command is being used.
With the systems getting faster through the years, it has been seen that print or remote writers may attempt to start before the QSPL subsystem job is completely started. If message CPF3348: Spooling subsystem is not active is found in the startup job log, another short delay should be considered after starting QSPL subsystem to allow the subsystem time to start and the QSTRRMTWTR autostart job entry to run.
Adding a delay before starting QSPL subsystem allows TCP/IP time to completely start. The recommendation is to delay at least 1 or 2 minutes.
Adding a delay after starting QSPL subsystem allows QSPL subsystem and remote writers time to start before calling QWCSWTRS to start print writers. The recommendation is to delay at least 10 or 15 seconds.
Here is information on determining the startup program, finding or retrieving the source and modifying it
1. By default, the system will use the QSYS/QSTRUP program. However, a modified startup program could be used too.
To determine the name and library for the startup program:
DSPSYSVAL SYSVAL(QSTRUPPGM)
Note the Startup program name and Library2. To determine where the program source for the startup program is located:
DSPOBJD OBJ(LibraryName/StartupPgmName) OBJTYPE(*PGM) DETAIL(*SERVICE)
Note the Source file, Library and Member names3. If currently using the IBM-supplied startup program, the DSPOBJD command will show something like this:
Source file . . . . . . . . . . . . : S000028739
Library . . . . . . . . . . . . . : $BLDSS1
Member . . . . . . . . . . . . . . . : S000028739
If so, retrieve the program source:
RTVCLSRC PGM(QSYS/QSTRUP) SRCFILE(QGPL/QCLSRC) SRCMBR(*PGM)If currently using a modified startup program, the DSPOBJD command will show something like this:
Source file . . . . . . . . . . . . : QCLSRC
Library . . . . . . . . . . . . . : QGPL
Member . . . . . . . . . . . . . . . : QSTRUP4. To edit the startup program source, use PDM or SEU. For example:
WRKMBRPDM FILE(QGPL/QCLSRC)
-or-
STRSEU SRCFILE(QGPL/QCLSRC) SRCMBR(QSTRUP)
Take option 2=Edit next to the QSTRUP, or startup program, source member.5. Locate the lines in the program that start QSPL subsystem. For example, the system-supplied startup program source for starting QSPL subsystem and calling QWCSWTRS to start print writers looks like this:
0044.00 DONE:
0045.00 QSYS/STRSBS SBSD(QSPL)
0046.00 MONMSG MSGID(CPF0000)
0047.00 QSYS/RTVSYSVAL SYSVAL(QSTRPRTWTR) RTNVAR(&STRWTRS)
0048.00 IF COND(&STRWTRS = '0') THEN(GOTO CMDLBL(NOWTRS))
0049.00 CALL PGM(QSYS/QWCSWTRS)
0050.00 MONMSG MSGID(CPF0000)
0051.00 NOWTRS:
0052.00 RETURN
0053.00 CHGVAR VAR(&CPYR) VALUE(&CPYR)
0054.00 ENDPGM6. Modify the program source code to add a Delay Job (DLYJOB) command before and after starting QSPL subsystem.
0044.00 DONE:
-->>> QSYS/DLYJOB DLY(120) /*Delay 2 minutes before starting QSPL to allow TCP/IP to start*/
0045.00 QSYS/STRSBS SBSD(QSPL)
0046.00 MONMSG MSGID(CPF0000)
-->>> QSYS/DLYJOB DLY(15) /*Delay 15 seconds before call QWCSWTRS to start print writers*/
0047.00 QSYS/RTVSYSVAL SYSVAL(QSTRPRTWTR) RTNVAR(&STRWTRS)
0048.00 IF COND(&STRWTRS = '0') THEN(GOTO CMDLBL(NOWTRS))
0049.00 CALL PGM(QSYS/QWCSWTRS)
0050.00 MONMSG MSGID(CPF0000)
0051.00 NOWTRS:
0052.00 RETURN
0053.00 CHGVAR VAR(&CPYR) VALUE(&CPYR)
0054.00 ENDPGM
After making the changes, press F3 twice to save and exit
Specify Change/create member as Y for Yes and press <ENTER>7. If using PDM, select option 14=Compile next to the modified startup program source, or issue:
CRTCLPGM PGM(QGPL/ProgramName) SRCFILE(QGPL/QCLSRC)
SRCMBR(QSTRUP) TEXT('User-modified startup program')8. Change the QSTRUPPGM system value to reference the new startup program name:
WRKSYSVAL SYSVAL(QSTRUPPGM)
Take Option 2=Change
Specify the new program name and library and press <ENTER>The above description is appropriate for those using the startup program released with the system. If you already have a modified startup program you must alter the above as needed.
Modifying the Operational Assistant Backup Exit Program to Start Writers after BackupsThe following provides an example of a user-written program, also known as an exit program, that can be used to tailor your Operational Assistant backup: Tailoring the Operational Assistant Backup Exit
If currently using an exit program with GO BACKUP, but writers are not starting automatically after backups, then the exit program should be changed to end the QSPL subsystem prior to performing backups and to restart the QSPL subsystem and call the QWCSWTRS CL program to start your printer writers after performing backups. For example:
PGM PARM(&PRODID &FLAG &OPTIONS &DEVS &TAPSET &RETCODE)
DCL VAR(&PRODID) TYPE(*CHAR) LEN(10) /* Calling product. +
Will be 'QEZBACKUP' when called from Operational Assistant. */
DCL VAR(&FLAG) TYPE(*CHAR) LEN(10) /* Indicates whether +
before or after backup. */
DCL VAR(&DEVS) TYPE(*CHAR) LEN(40) /* Devices used. */
DCL VAR(&TAPSET) TYPE(*CHAR) LEN(4) /* Tape set name */
DCL VAR(&RETCODE) TYPE(*CHAR) LEN(7) /* Return code */
DCL VAR(&OPTIONS) TYPE(*CHAR) LEN(10) /* Options used */
IF COND(&FLAG *EQ '*BEFORE ') THEN(DO)
/*--------------------------------------------------------*/
/* Insert commands to be run before the backup here. */
/*--------------------------------------------------------*/
/*--------------------------------------------------------*/
/* End QSPL subsystem since network printers won't be */
/* able to print while TCP/IP communications is down */
/*--------------------------------------------------------*/
ENDSBS SBS(QSPL) OPTION(*IMMED)
MONMSG MSGID(CPF0000)
ENDDO
IF COND(&FLAG *EQ '*AFTER ') THEN(DO)
/*--------------------------------------------------------*/
/* Insert commands to be run after the backup here. */
/*--------------------------------------------------------*/
/*--------------------------------------------------------*/
/* Restart the QSPL subsystem and call the QWCSWTRS CL */
/* program to start printer writers after a 10 minute */
/* delay, which should give TCP/IP communications */
/* enough time to fully up-and-running before starting */
/* printer writers for any network printers */
/*--------------------------------------------------------*/
QSYS/DLYJOB DLY(120) /*Delay 2 minutes to allow TCP/IP to completely start*/
QSYS/STRSBS SBSD(QSPL)
QSYS/DLYJOB DLY(15) /*Delay 15 seconds to allow QSPL to completely start*/
MONMSG MSGID(CPF0000)
CALL PGM(QSYS/QWCSWTRS)
MONMSG MSGID(CPF0000)
ENDDO
ENDPGM
This is particularly important if TCP/IP communications is halted while performing backups so the system will not attempt to print to network printers without TCP/IP communications.
Calling the QWCSWTRS CL Program to Start Printer Writers Instead of STRPRTWTR WTR(*ALL) The QWCSWTRS program is used in the IBM-supplied startup program to start print writers after starting QSPL subsystem. If the startup program is instead issuing STRPRTWTR WTR(*ALL), then it should be changed to call the QWCSWTRS program instead. The QWCSWTRS program loops 20 times checking to see if a printer device varies on after the IPL. If so, a print writer is started for it. If the printer device does not vary on, such as with a 'dummy' printer device description for a remote output queue, a print writer is not started for it.
The benefit of calling QWCSWTRS instead of using STRPRTWTR WTR(*ALL) is STRPRTWTR will attempt to start a print writer for any and all printer device descriptions regardless if the device is varied on or not.
Refer to section Modifying the QSTRUP CL Source Code to Add a Delay Before and After Starting QSPL Subsystem for the recommended sample code to use.
Modifying the QWCSWTRS Program to Increase the Number of Loops (&MAXLOOP) or the Delay Between Loops (&DELAY)The QWCSWTRS program loops 20 times with a 5 second delay between each loop, to check to see if a printer device varies on after an IPL. If so, a print writer is started for it. If not, such as with a 'dummy' printer device description for a remote output queue or virtual printer devices for printer sessions, a print writer is not started for it. The QWCSWTRS program can be modified to change the number of times it loops and the delay between loops.
0075.00 CHGVAR VAR(&DELAY) VALUE(30)
0076.00 CHGVAR VAR(&MAXLOOP) VALUE(25)Retrieving the CL Source for the QWCSWTRS Program and Changing the Number of Loops and Delay
1. RTVCLSRC PGM(QSYS/QWCSWTRS) SRCFILE(QGPL/QCLSRC) 2. To edit the QWCSWTRS program source, use PDM or SEU. For example:
WRKMBRPDM FILE(QGPL/QCLSRC)
-or-
STRSEU SRCFILE(QGPL/QCLSRC) SRCMBR(QWCSWTRS)
Take option 2=Edit next to the QWCSWTRS source member.3. Locate the lines 0075 and 0076:
0073.00 CHGVAR VAR(&COUNTFP) VALUE(0)
0074.00 CHGVAR VAR(&COUNTWTS) VALUE(0)
0075.00 CHGVAR VAR(&DELAY) VALUE(5) <<-----
0076.00 CHGVAR VAR(&MAXLOOP) VALUE(20) <<-----
0077.00 CHGVAR VAR(&MAXPPL) VALUE(100)
0078.00 CHGVAR VAR(&SUMPRTRS) VALUE(0)4. Modify the value for each that you wish to change. For example, to change the delay to 10 seconds and the maximum number of loops to 30:
:
0073.00 CHGVAR VAR(&COUNTFP) VALUE(0)
0074.00 CHGVAR VAR(&COUNTWTS) VALUE(0)
0075.00 CHGVAR VAR(&DELAY) VALUE(10) <<-----
0076.00 CHGVAR VAR(&MAXLOOP) VALUE(30) <<-----
0077.00 CHGVAR VAR(&MAXPPL) VALUE(100)
0078.00 CHGVAR VAR(&SUMPRTRS) VALUE(0)
:
After making the change(s), press F3 twice to save and exit
Specify Change/create member as Y for Yes and press <ENTER>5. The system-supplied QWCSWTRS program can be renamed to XWCSWTRS so that it can be renamed back if any issues are found with the modified QWCSWTRS source code, for example:
RNMOBJ OBJ(QSYS/QWCSWTRS) OBJTYPE(*PGM) NEWOBJ(XWCSWTRS)
Then a modified version of QWCSWTRS program can be created using the Create CL Program (CRTCLPGM) command, for example:
CRTCLPGM PGM(QSYS/QWCSWTRS) SRCFILE(QGPL/QCLSRC) SRCMBR(*PGM)
TEXT(*SRCMBRTXT)
Note: If needed the system-supplied QWCSWTRS program can be put back in place by deleting the modified version and renaming the XWCSWTRS program back to QWCSWTRS, for example:
DLTPGM PGM(QSYS/QWCSWTRS)
RNMOBJ OBJ(QSYS/XWCSWTRS) OBJTYPE(*PGM) NEWOBJ(QWCSWTRS)
Historical Number
8064431
Was this topic helpful?
Document Information
Modified date:
04 May 2026
UID
nas8N1010213