7.6 Managing Printers
To manage printers attached to your system, you perform
the following tasks:
Task For More Information
The following sections explain these tasks.
In addition, if you want to spool your printers, you must do so
before starting the queues to be associated with those printers.
For information about spooled printers, see Section 7.6.2.
To execute these commands each time your system boots,
add these commands to your site-specific startup command
procedure. If your configuration is simple, you can add the
commands to SYSTARTUP_VMS.COM. If your configura-
tion requires a large number of commands, create a separate
command procedure (for example, PRINTER_SETUP.COM)
and execute it from SYSTARTUP_VMS.COM. When the de-
vice setup command procedure finishes executing, control
returns to SYSTARTUP_VMS.COM.
Example
The following example provides sample commands you could
include in your startup procedure to set device characteris-
tics for printers. This example also includes the commands
used to spool printers. You generally include the commands
to spool printers along with the commands to set device
characteristics.
$! Set up line printer devices
$!
$ SET PRINTER/PAGE=60/LOWERCASE/TRUNCATE LPA0:
$ SET PRINTER/LA11/UPPERCASE/WRAP LPB0:
$ SET DEVICE/SPOOLED=(LINE_PRINT,SYS$SYSDEVICE) LPA0:
$ SET DEVICE/SPOOLED=(SYS$PRINT,SYS$SYSDEVICE) LPB0:
$!
$! Set up LAT printers
$!
$ SET TERMINAL LTA331:/SPEED=9600/DEVICE=LN03 -
/NOBROADCAST/NOECHO/HARDCOPY/NOTYPE_AHEAD/PERMANENT
$ SET DEVICE LTA331:/SPOOLED=(MKTG$LN03_1,SYS$SYSDEVICE)
$!
$ SET TERMINAL LTA332:/DEVICE=LA210/PAGE=66 -
/NOBROADCAST/PERMANENT
$ SET DEVICE LTA332:/SPOOLED=(LA210$PRINT,SYS$SYSDEVICE)
7.6.2 Using Spooled Printers
Certain application programs print output by writing or
copying data directly to a printer rather than submitting it to
a queue. A spooled printer causes such an application pro-
gram to write output to an intermediate storage device (such
as a disk) so that the printer targeted to print the output re-
mains available to other system users while the program is
running.
When you spool a printer, you specify a storage device and an
output queue to be associated with that printer. When a pro-
cess running an application directs its output to the spooled
printer, the output is instead placed in a temporary file on
the storage device. When the file is closed, the system sub-
mits the file for printing on the associated output queue. Both
the spooling of the output file to an intermediate storage de-
vice and the subsequent queuing of a job consisting of this file
occur without the direct intervention of the user.
If your system runs application programs that might write
output directly to a printer, Digital recommends you spool
your printers. Digital recommends you also spool your LAT
printers to prevent privileged users from writing directly to
a LAT printer. Writing directly to a LAT printer can cause
problems for output queues that use the printer.
If you want to spool your printers, you must do so before
starting the queues to be associated with those printers.
Figure 13-9 illustrates a sample configuration using spooled
printers. Section 7.6.2.1 describes how to set up a spooled
printer.
7.6.2.1 Spooling Printers
To spool a printer, use the SET DEVICE/SPOOLED com-
mand. This command associates the printer with a storage
device (such as a disk) and an output queue.
You must spool a printer before you start the queue to be
associated with the printer.
Enter the DCL command SET DEVICE/SPOOLED in the
following format:
SET DEVICE/SPOOLED[=(queue-name[:],intermediate-disk-name[:])]
output-device-name
You should always specify the intermediate disk and queue
explicitly. If the queue you associate with the spooled output
device is a generic queue, a file written to that device is sent
to the generic queue, which in turn places the job in one of
its target queues. As a result, a job copied to the LPA0: de-
vice, for example, might not necessarily print on the printer
LPA0:, but instead might print on one of the other printers
targeted by the generic queue.
When you select an intermediate storage device, make sure
that it has sufficient free space for the volume of spooled out-
put. If you plan to enforce disk quotas on the intermediate
device, make sure that all expected users have a quota au-
thorized on the intermediate device. The intermediate device
must be mounted before files can be written to it.
After establishing an output device as spooled, you should test
the device, because errors in disk or queue names are not de-
tected until spooling is attempted. This step is described in
Section 7.6.2.3.
You should create a command procedure to set up your out-
put devices each time the system reboots. Include the com-
mands to set up spooled devices in this command procedure.
For more information, see Section 7.6.1.
Example
The following example illustrates sample commands used
to set up spooled printers. This example also includes the
command used to set device characteristics. You generally
include the commands to spool printers along with the com-
mand to set device characteristics in a startup command
procedure to set up output devices.
$! Set up and spool line printer devices
$!
$ SET PRINTER/PAGE=60/LOWERCASE/TRUNCATE LPA0:
$ SET PRINTER/LA11/UPPERCASE/WRAP LPB0:
$ SET DEVICE/SPOOLED=(SYS$PRINT,SYS$SYSDEVICE) LPA0: 1
$ SET DEVICE/SPOOLED=(SYS$PRINT,SYS$SYSDEVICE) LPB0:
$!
$! Set up and spool LAT printers
$!
$ SET TERMINAL LTA331:/SPEED=9600/DEVICE=LN03 -
/NOBROADCAST/NOECHO/HARDCOPY/NOTYPE_AHEAD/PERMANENT
$ SET DEVICE LTA331:/SPOOLED=(MKTG$LN03_1,SYS$SYSDEVICE) 2
$!
$ SET TERMINAL LTA332:/DEVICE=LA210/PAGE=66 -
/NOBROADCAST/PERMANENT
$ SET DEVICE LTA332:/SPOOLED=(LA210$PRINT,SYS$SYSDEVICE) 3
1 Spools the output device LPA0: by associating it with
the storage device SYS$SYSDEVICE and the queue
SYS$PRINT. When output from an application is di-
rected to LPA0:, the data is temporarily stored on
SYS$SYSDEVICE until the application completes. This
keeps the output device LPA0: available for other jobs
until the application's output is ready for printing. When
the application completes, its output is submitted to the
queue SYS$PRINT.
2 Spools the LN03 device on LAT port LTA331: by associ-
ating it with the storage device SYS$SYSDEVICE and the
queue MKTG$LN03_1. Digital recommends you spool
LAT printers.
3 Spools the LA210 device on LAT port LTA332: by associ-
ating it with the storage device SYS$SYSDEVICE and the
queue LA210$PRINT.
7.6.2.2 Despooling a Spooled Printer
Occasionally, you might need to disable spooling on a device.
For example, the SET TERMINAL command can be exe-
cuted only on a despooled output device. If you need to disable
spooling to an output device, use the SET DEVICE command
with the /NOSPOOLED qualifier.
You must stop the corresponding queues before you can
change the spooling status.
For more information about the SET DEVICE/NOSPOOLED
command, see the OpenVMS DCL Dictionary .
7.6.2.3 Testing a Spooled Printer
After establishing an output device as spooled, you should test
the device, because errors in disk or queue names are not de-
tected until spooling is attempted. To test a spooled device, use
a command procedure similar to the following:
$! *****TESTING SPOOLED DEVICE***
$!
$! set the device spooled
$ SET DEVICE/SPOOLED=(SYS$PRINT,SYS$SYSDEVICE:) LPA0:
$!
$! create a test file
$ CREATE TEST.LIS
!Add the first test record here.
!Ctrl/Z to exit the file
$!
$! write the file to the output device
$ COPY TEST.LIS LPA0:
$ EXIT