ACUCOBOL-GT's name translation rules make it particularly easy to access a site's printers (and other devices) in a machine-independent fashion.
We recommend that you use some pre-designated names in your ASSIGN statements for files that are to be directed to a printer. Using these names will simplify the installation of runtime systems for sites using several ACUCOBOL-GT applications. The ASSIGN name for standard print files should be PRINTER, or one of its variants PRINTER1, PRINTER2, etc. By convention, PRINTER is associated with the default printer on the host system, while the alternate names are associated with additional printers. For print files where you need direct control over the printer (to align special forms, for example), you should use one of the names: FORM, FORM1, FORM2, etc. By convention, FORM devices are directly attached to the printer and PRINTER devices access printers through the system spooler (if available).
Each site can then place the appropriate definitions of these names in the configuration file. The installation of FORM devices is easy--simply name the device using the -D flag. See Runtime Configuration for more information.
For example, to associate the name FORM with the /dev/lp device on a UNIX system, place the following line in the configuration file:
FORM -D /dev/lp
It is important to ensure that the users have access permissions to the named devices. For more information about print spooler issues, see WIN$PRINTERWIN$PRINTER.
The installation of PRINTER devices is only slightly more complicated. Because these should be spooled (if possible), you will usually need to use the -P flag to specify a program to receive the print output. The following notes give examples for various operating systems:
For example, suppose the site has two printers, a high-speed line printer (the default) and a laser printer. Furthermore, suppose System V UNIX is being used and the laser printer is accessed with the flag -dlaser.
The following two lines should then be placed in the configuration file:
PRINTER... -P lp -s PRINTER1 -P lp -s -dlaser
PRINTER -P %TMP% PRINT /NOIDENT /DELETE %TMP%
Be sure to use the options shown above (NOIDENT and DELETE), and feel free to add other options as desired.