Controlling Printer Writers

There is more to controlling printed output than just changing, holding, canceling, and releasing reports. You can also control the printer writers themselves.

A printer writer is a program created by the system whenever you create a new printer device description (using the CRTDEVPRT command). All printer writers have the same name as the printer device they control. The printer writer takes the information out of an output queue and into the printer itself. In essence, the printer writer is a program that acstually and physically does the printing. You can control which output queue is processed by a certain printer writer.

i5/OS can't control the printer hardware itself. For example, no i5/OS command can turn a printer off or on, or push its online button to turn it on-or offline. The i5 can, however, control the spool writers, which is even better.

Starting and Ending Writers

The Start Printer Writer (STRPRTWTR) command starts a new job in subsystem QSPL. The spool writer runs in this new job. The End Writer (ENDWTR) command ends that QSPL job. These commands provide "hard" starts and stops for printer writers, so you should use them sparingly.

When you start a printer writer, you can specify which output queue will be processed by the writer, what message queue will receive the messages about the printer, and what form type you want to process now. Other choices are available in the STRPRTWTR command, but they are not discussed in this book.

For example, you can start the writer for printer SYSPRT01 as follows:


Or, suppose you want to start the writer for ACGPRT01 so that it prints all reports from output queue QPRINT that have forms INVOICE:


To end a writer, run the ENDWTR command. You can choose when to end the writer using the OPTION parameter immediately (*IMMED) at the end of the current spool file so that it can finish printing (*FILEEND), at the end of the current page (*PAGEEND), or as soon as no more spool files are ready (*NORDYF).

For example, consider the following:


The writer for printer SYSPRT01 ends immediately. Because the job is ending immediately, it's considered an abnormal end by the system and, since the printer writer is a job in subsystem QSPL, the system will generate a job log when the writer ends.

IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators
IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators
Year: 2004
Pages: 245 © 2008-2017.
If you may any questions please contact us: