Chapter Contents

Previous

Next
SAS Companion for UNIX Environments

Setting Up Host Printing

If you choose to use host printing, you must first turn on host printing and set up your printer devices. You can set up a printer device to send output to a printer or to a file that is compatible with a specific Postscript or PCL printer. After you set up a printer, you can change options such as fonts, margins, orientation, and page size.

Note:   Printer device definitions are stored in your SASUSER.PROFILE catalog. You cannot use profile catalogs from previous releases of SAS. If you have been running a revious release of SAS, rename the PROFILE.SCT01 file located in your SASUSER directory before you start your SAS session.  [cautionend]


Turning Host Printing On and Off

Host printing is not available by default, so you must turn host printing on before you will be able to access the host printing menus. Host printing can be turned on

After you turn host printing on, the Print Utilities selection in the File pull-down menu is replaced with two new selections:

Print preview...
enables you to view text and graphics on the screen before you send it to a printer.

Print setup...
enables you to define host printer devices (which can be a printer or a file) and select one of these devices as your default printer device.

Host printing will remain active until you turn it off. You can turn host printing off by issuing the DLGPRTMODE GRAPH command or by deselecting Use host printing in the Preferences dialog box.


Setting Up Your Own Printer Devices

Note:    If you are a system administrator and you are creating printer device definitions for use by all of the users at your site, see Setting Up Printers for All Users at Your Site.  [cautionend]

To set up your own printer devices, open the Printer Setup dialog box either by issuing the DLGPRTSETUP command or by selecting

File
[arrow]
Print Setup...
(This pull-down menu selection appears only after you have turned on host printing.) This dialog box lists the printer devices that your SAS Installation Representative has defined for your site, and it lists each of the printer devices that you have defined. Printers that are defined by your Installation Representative are shown with a printer icon, and devices that you have defined are shown with an icon denoting a person.

Printer Setup Dialog Box

[IMAGE]

SAS automatically defines one printer device for you: Print PostScript to disk. This device formats output in generic Postscript using Courier font with no margins and prints the output to a file named prn.ps in the current directory. Your SAS Installation Representative might have also defined other devices for your site. Your default printer device is highlighted. To change your default printer device to another device that is already defined, simply select the new default device and select [OK].

For each new printer device that you want to define, follow these steps:

  1. Select New.... SAS builds a list of the printer types available at your site and prompts you for the name you want to assign to the device you are creating.

    Note:   At any point during this set-up process, you can select <-Previous to return to the previous step.  [cautionend]

  2. Type the name that you want to use to identify the printer device and press Enter or select [Next->]. You can enter up to 99 characters in the name. Use a name that distinguishes this device from the others that you define such as "Apple printer with one-inch margins." SAS then prompts you to enter which type of printer device that you are defining.

  3. Select the printer type from the list. If your specific printer type is not in the list, try one of the generic drivers, such as Generic Postscript. If the generic driver does not work, try a driver for a related printer. Often, printers made by the same manufacturer have similar specifications. Also, your printer may emulate one of the printers on the list. For example, many laser printers emulate Hewlett-Packard LaserJet printers. If you cannot determine which printer type to choose from the list, contact your SAS system administrator.

    After you select a printer type, press Enter or select [Next->] to select an output destination.

  4. To send output directly to the printer, select Printer and type the command necessary to route output to the printer that you are defining. Include the full pathname of the command.

    To send output compatible with the selected printer to a file, select File and type the filename to which you want to send output.

    Note:   If you are using a LaserJet printer in PCL or HPGL mode, you will probably want to create two printer device definitions: one for text and one for graphics. When you are printing graphics in PCL or HPGL mode, you may need to add the -oraw option to your lp or lpr command. If the -oraw option is not available on your system, contact SAS system administrator for additional information.

    PostScript printer devices can be used for printing text or graphics.  [cautionend]

    Press Enter or select Next-> to finish the process of defining the printer device.

  5. Select Finish to return to the Printer Setup dialog box.

    At this point, you can do any of the following:

  6. Select [OK] to exit the Printer Setup dialog box. Your device definitions are saved to SASUSER.PROFILE.PRTINFO.XPRINTER.


Removing a Printer from the Selection List

To remove a printer device from the selection list, open the Printer Setup dialog box by issuing the DLGPRTSETUP command or select

File
[arrow]
Print Setup...
In the Printer Setup dialog box, select the printer that you want to remove and then select [Remove...]. SAS asks you to confirm your request. Only your system administrator can remove printers that the administrator has defined for your site. If you select a printer that was defined by your system administrator, the [Remove...] button will be shaded.


Changing Printer Device Properties (Fonts, Margins, Other Options)

To change the properties for a printer device, issue the DLGPRTSETUP command or select

File
[arrow]
Printer setup...
Select the printer device for which you want to change properties, and then select [Properties...]. SAS displays the Printer Properties dialog box.

Printer Properties Dialog Box

[IMAGE]

Note:   The Font: field and the [Font...] and [Margins...] buttons will not appear if this dialog box is invoked from a GRAPH window. Fonts and margins set through this dialog box affect only printing from text windows. To change fonts and margins when printing from GRAPH windows, use the GOPTIONS statement.  [cautionend]

Name:
displays the name that you entered for the device when you set it up. You can edit the name.

Model:
displays the vendor and model for the printer you selected for this device. You cannot change this information directly. You can return to the Print Setup dialog box, remove the printer device, and create a new device definition.

Route output to
allows you to select whether the device sends output directly to the named printer or to a file compatible with the named printer. If you select File, the text field contains the name of the file. If you select Printer, the text field contains the command that is needed to route your output directly to the named printer. You can edit the filename or command as needed.

Font:
displays the current font.

Line Size: and Page Size:
display the line size and page size that SAS has calculated for the current options, margins, and font settings. You cannot set these values directly, but they will change according to the paper size, font, margins, and orientation settings that you specify.

Note:   After you have finished defining all of the options for your printer device, check these line size and page size values. Make sure than the LINESIZE and PAGESIZE system options specified for your application are less than or equal to the line size and page size that SAS has calculated for the current printer options.   [cautionend]

[Options...]
opens the Options dialog box which allows you to change paper size, orientation, resolution, paper tray, and scale. See Setting Printer Options for more information.

[Margins...]
opens the Margins dialog box, which allows you to change the top, bottom, left, and right margins for when you print from text windows. You can enter settings directly into each field or change the settings with the up and down arrows to the right of each field. All measurements are in inches. If you enter measurements in centimeters, they will be converted to inches. For example, if you enter 2.54 cm, the Margins dialog box will display 1.00" the next time you open the dialog box. Increasing the top or bottom margins will decrease the page size value displayed in the Printer Properties dialog box, and increasing the left or right margins will decrease the line size value.

Select [OK] when you have finished.

When you print from a GRAPH window, you must use a GOPTIONS statement to set the font and margins. Font and margin settings that are entered through the UNIX dialog boxes have no effect when you print from GRAPH windows.

[Font...]
displays the Host Font dialog box, which allows you to change the font for printing from text windows. Use the GOPTIONS statement to specify the font that will be used for printing from GRAPH windows. See Changing Printer Fonts for more information.


Setting Printer Options

When you select [Options...] from the Printer Properties dialog box, SAS displays the Printer Options dialog box.

Printer Options Dialog Box

[IMAGE]

To change the paper size, resolution (in dots per inch), or paper tray, select the down arrow to the right of the field and select the value you want. The resolution is listed in dots per inch (dpi). Most printers are either 300 or 600 dpi. Higher dpi values produce sharper text and graphics. To change the orientation, select Portrait or Landscape.

The value in the Scale: field tells the printer device how large the output should be. To enlarge your document, enter a number greater than 100. To reduce your document, enter a number less than 100. For example, a scaling factor of 50% will print your document at half of its original size, and a scaling factor of 200% will print your document at twice its original size. To change the scale, either type a new number in the Scale: field or select the arrows to the right of the field. If you increase the scale value, the line size and page size values shown in the Printer Properties dialog box will decrease. If you decrease the scale value, the line size and page size values will increase.

When you have finished making changes, select [OK].

Changing Printer Fonts

The Host Fonts dialog box allows you to change the windowing environment font and the printer fonts that will be used when you print from text windows.

To change printer fonts, you must access the Host Fonts dialog box through the Printer Properties dialog box by selecting [Font...]. Changing the font for a printer device will change the line size and page size values shown in the Printer Properties dialog box for that printer. For a complete description of the Host Fonts dialog box, see Customizing Fonts.

The default printer font for PostScript printers is Courier, and the default font for PCL printers is HP Lineprinter. (The Host Fonts dialog box for printers does not have a [Default] button.)

Note:   SAS output is formatted for a monospace font (each character is the same width) such as Courier, Lineprinter, or Letter Gothic. Using a proportional-space font (the width of the characters vary) such as Helvetica or Times produces an improperly formatted report. If you select a proportional font, SAS will display a message that warns of unpredictable results and column misalignment in your output.  [cautionend]


Specifying Your Default Printer Device

To change the default printer device, open the Printer Setup dialog box either by issuing the DLGPRTSETUP command or by selecing

File
[arrow]
Print Setup...
Select the new default device and select [OK].

The SAS System looks for default printer definitions in

  1. the value of the XPRINTNM system option. The value that you specify for this option must match exactly the printer name specified through the Printer Setup dialog box. For example:
    OPTIONS XPRINTNM='HP LaserJet in Room 123';
    If you misspell the name or use the wrong case (uppercase or lowercase), SAS will display an error message stating that it cannot find the printer. See XPRINTNM for more information.

    Note:   If you change the default printer using the XPRINTNM system option, this change is reflected in the Printer Setup dialog box. However, if you change your default printer through the Printer Setup dialog box, this change is not reflected in the value of the XPRINTNM system option.  [cautionend]

  2. SASUSER.PROFILE.PRTINFO.XPRINTER. This entry contains the printer device definitions that you entered through the Printer Setup dialog box. See Setting Up Your Own Printer Devices for more information.

  3. SASUSER.XPRINT.PRTINFO.XPRINTER. This entry contains the printer device definitions that your system administrator has defined for your site. Your system administrator may have specified a default printer device for your site. See Setting Up Printers for All Users at Your Site for more information.


Setting Up Printers for All Users at Your Site

If you are the SAS Installation Representative for your site, you can set up a catalog that contains printer definitions available on the system and make this catalog available to all users at your site. As part of this process, you choose a default printer.

  1. Make sure you have write access to the $SASROOT/sashelp directory. Write access to this directory may require root access. See your system administrator for details.

  2. Make sure that no one is using the SAS System.

  3. Check your SASUSER.PROFILE for an entry named PRTINFO.XPRINTER. If this entry exists, delete it.

  4. Issue the command DLGPRTSETUP SASHELP.XPRINT.PRTINFO. This command displays the Printer Setup dialog box.

  5. For each printer needed by the users at your site, follow the instructions listed in Setting Up Your Own Printer Devices. After you have defined the list of printer devices that are available at your site, you can select the device that you want to be the default device for your users, and then select [OK] to exit the Printer Setup dialog box. The list of printer devices is saved to SASHELP.XPRINT.PRTINFO.XPRINTER.

  6. Exit from your SAS session.

After you set up the printers for your site, when users invoke the Printer Setup dialog box, they will be able to choose any of the printers that you have defined as their default printer.


Adding New XPRINTER Devices

If your site acquires a new printer or plotter model, you might need to add the new device to the list of XPRINTER devices that the user can select. To add new printer or plotter devices, follow these steps:

  1. Obtain a Postscript Printer Description (PPD) file from the printer manufacturer. These files are often shipped on a disk with the printer or plotter. The filename extension is usually .ppd.

  2. Change the filename extension to .ps.

  3. Copy the file into the $SASROOT/X11/xprinter/ppds directory.

You can add your own Postscript, PCL4, or PCL5 device drivers to the list of device drivers that SAS Institute distributes. However, SAS Institute is not able to provide support or fixes for your own device drivers.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.