Kbase 12801: Printing on VMS:workaround for queued device/alternat prntr
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Printing on VMS:workaround for queued device/alternat prntr
You cannot explicitly print to queued or spooled devices with PROGRESS
running on the VMS operating system. You can print directly to the
terminal, to an actual device, or the printer, but not to a device
that is associated with a queue.
This notebook entry describes how to redirect output to a queued
device or to a printer other than the default printer, SYS$PRINT.
To re-define SYS$PRINT to a preferred device, add the following line
to the code before the OUTPUT TO PRINTER statement.
VMS SILENT "DEFINE/JOB SYS$PRINT print$laser".
Note: print$laser is a queue device on the node.
The VMS statement is documented in the "PROGRESS Language Reference".
To write operating system-specific code within your program, use the
OPSYS function with the VMS statement, as demonstrated in the
following example.
IF OPSYS = "VMS" THEN
DO: VMS "define/job sys$print print$laser".
OUTPUT TO PRINTER.
END.
ELSE IF OPSYS = "MSDOS" THEN ....
ELSE IF OPSYS = "UNIX" THEN .....
For more information, see the 'OPSYS Function' section of the
"PROGRESS Language Reference".
Send output to a file during the PROGRESS procedure then have the
program run the VMS command procedure which prints the file, as
shown in the following example.
OUTPUT TO TEST.TXT.
FOR EACH customer: DISPLAY customer.
OUTPUT CLOSE.
VMS SILENT "@PRINT.COM".
Note: print.com contains the following:
print/queu=print$laser test.com.
You can make this command file as robust as needed. This
would also be helpful when you want to submit this to batch
to be printed at a later date.
To change the default printer for the entire PROGRESS session, use
the /PRINTER option. For more information, see the 'Printer` section
in Chapter 3, 'Startup Options,' of the "PROGRESS System
Administration II" guide.
For more programming tips on application portability across
platforms, please refer to Chapter 14 in the "PROGRESS Programming
Handbook".
Progress Software Technical Support Note # 12801