skip book previous and next navigation links
go up to top of book: HP OpenVMS System Manager's Manual, Volume 1:... HP OpenVMS System Manager's Manual, Volume 1:...
go to beginning of chapter: Managing Peripheral Devices Managing Peripheral Devices
go to previous page: Managing Modems Managing Modems
go to next page: Managing Tape DrivesManaging Tape Drives
end of book navigation links

Managing Printers  



To manage printers attached to your system, perform the following tasks:

Task For More Information
Set printer characteristics
Setting Printer Characteristics
Spool printers
Spooling Printers
Despool printers
Despooling a Spooled Printer
Test spooling of printers
Testing a Spooled Printer

Setting Printer Characteristics  

Printer characteristics must be set prior to starting queues for the printers. The DCL command SET PRINTER establishes characteristics for a line printer. The DCL command SET TERMINAL sets characteristics for a printer connected to a terminal or LAT port.

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 Using Spooled Printers.

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 configuration 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 device 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 characteristics 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) 

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 program to write output to an intermediate storage device (such as a disk) so that the printer targeted to print the output remains 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 process 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 submits the file for printing on the associated output queue. Both the spooling of the output file to an intermediate storage device 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, HP recommends that you spool your printers. HP recommends that 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.

Queue Configuration with Spooled Devices illustrates a sample configuration using spooled printers. Spooling Printers describes how to set up a spooled printer.

Spooling Printers  

To spool a printer, use the SET DEVICE/SPOOLED command. 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: device, 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 output. If you plan to enforce disk quotas on the intermediate device, make sure that all expected users have a quota authorized 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 detected until spooling is attempted. This step is described in Testing a Spooled Printer.

You should create a command procedure to set up your output devices each time the system reboots. Include the commands to set up spooled devices in this command procedure. For more information, see Setting Printer Characteristics.

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 command 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 directed 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 associating it with the storage device SYS$SYSDEVICE and the queue MKTG$LN03_1.
  3. Spools the LA210 device on LAT port LTA332: by associating it with the storage device SYS$SYSDEVICE and the queue LA210$PRINT.

Despooling a Spooled Printer  

Occasionally, you might need to disable spooling on a device. For example, the SET TERMINAL command can be executed 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, refer to the HP OpenVMS DCL Dictionary .

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 detected until spooling is attempted. To test a spooled device, use a command procedure similar to the following one:

$!          *****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

go to previous page: Managing Modems Managing Modems
go to next page: Managing Tape DrivesManaging Tape Drives