Previous Page | Next Page

Printing with SAS

Managing Printing Tasks with the Universal Printing User Interface


Overview of the Universal Printing Menu

Most SAS Universal Printing windows are accessible from the File menu.

The following display shows the File menu containing the Universal Printing choices of Page Setup, Print Setup, Print Preview, and Print.

File Menu Displaying Universal Printing Options

[File Menu Displaying Universal Printing Options]

Menu Choices or Commands to Open Universal Printing Windows
Menu Choice Equivalent Command
Page Setup DMPAGESETUP
Print Setup DMPRINTSETUP
Print Preview DMPRTPREVIEW
Print DMPRINT

Operating Environment Information:   In the Windows operating environment, SAS uses the Windows print windows as the default. To access the Universal Printing user interface, the UPRINTMENUSWITCH system option must also be set along with the UNIVERSALPRINT system option to configure all menus in SAS to use the Universal Printing windows. To do this, include

-uprint -uprintmenuswitch

in the string that you use to invoke SAS in Windows.  [cautionend]

You can open all Universal Printing windows by entering commands at the command line or into the command box in the menu bar. The following table lists the commands that you use to do the most common tasks.

Commands to Open Universal Printing Windows
Action Command
Print the current window DMPRINT
Change the default printer DMPRINT, or DMPRINTSETUP
Create a new printer or previewer definition DMPRTCREATE PRINTER, or DMPRTCREATE PREVIEWER
Modify, add, remove, or test printer definitions DMPRINTSETUP
Show default printer properties sheet DMPRINTPROPS
Show page properties sheet DMPAGESETUP
Print preview the current window DMPRTPREVIEW


Setting Up Printers


Print Setup Window

The File [arrow] Print Setup menu selection opens the Print Setup window, where you can perform the following tasks:

Alternatively, you can issue the DMPRINTSETUP command.


Change the Default Printer

To change the default printer device for this SAS session and future SAS sessions, follow these steps:

  1. Select File [arrow] Print Setup. The Print Setup window appears.

  2. Select the new default device from the list of printers in the Printer field.

  3. Click OK.

Alternatively, you can issue the DMPRINTSETUP command.


Remove a Printer from the Selection List

To remove a printer from the selection list:

  1. Select File [arrow] Print Setup. The Print Setup window appears.

  2. Select the printer you want to delete from the list of printers in the Printer field

  3. Click Remove.

Note:   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 unavailable.  [cautionend]

Alternatively, you can issue the DMPRINTSETUP command.


Define a New Printer

While Universal Printing provides you with predefined printers, you can also add your own printers with the Define a New Printer wizard, which guides you step-by-step through the process of installing a printer.

To start the New Printer wizard and define a new printer, follow these steps:

  1. Select File [arrow] Print Setup and click New. The following window appears.

    Printer Definition Window to Enter Name and Description

    [Printer Definition Window to Enter Name and Description]

    Alternatively, you can either issue the DMPRTCREATE PRINTER command or issue the DMPRINTSETUP command and click New.

  2. Enter the name and a description for the new printer (127 character maximum, no backslashes).

  3. Click Next to proceed to Step 2 of the wizard. Select a printer model. If your exact printer model is not available, select a general model that is compatible with your printer. For example, for the HP LaserJet printer series, select PCL5.

    Note:   General models might provide fewer options than specific models.  [cautionend]

    Printer Definition Window to Select Printer Model

    [Printer Definition Window to Select Printer Model]

  4. Click Next to proceed to Step 3 of the wizard. The following window appears:

    Printer Definition Window to Select Output Device

    [Printer Definition Window to Select Output Device]

  5. Select the Device type for your print output. The device type selections are host-dependent.

    If you select Catalog, Disk, Ftp, Socket, or Pipe as the device type, then you must specify a destination.

    If you select a device type of Printer, then a destination might not be required, because some operating environments use the Host options box to route output.

    Note:   Examples for your operating system of Device Type, Destination, and Host options are also provided in Sample Values for the Device Type, Destination, and Host Options Fields.  [cautionend]

  6. Enter the Destination for your file. The destination is the target location for your device type. For example, if your device type is disk, then your destination is an operating environment-specific filename. With some system device types, the destination might be blank and you can specify the target location using the Host options box.

  7. Select or enter any host-specific options for the device that you chose. This field might be optional for your operating environment. For a list of host options, refer to the FILENAME statement information for your operating environment.

    Note:   The Destination and Host Options lists can also be populated using the REGISTRY procedure. Click the Help button in step 3 to refer to the "Populating Destination and Host Option Lists" topic, which contains more details.  [cautionend]

  8. Click Next to proceed to Step 4 of the wizard, in which you select from a list of installed print previewers. If no previewers are defined, proceed to the next step of the wizard.

    Printer Definition Window to Select Previewer

    [Printer Definition Window to Select Previewer]

    If the previewer selection box appears, select the previewer for this printer. If you do not need a previewer, choose None or leave the field blank.

    Note:   You can add a previewer to any printer through the DMPRTCREATE PREVIEWER command. For more information, see Define a New Previewer.  [cautionend]

    Note:   It is not required that printers and print previewers share a common language.  [cautionend]

  9. Click Next to proceed to Step 5 of the wizard. The following window appears:

    Printer Definition Window to Complete Process

    [Printer Definition Window to Complete Process]

  10. Click Previous to change any information. Click Finish when you have completed your printer definition.

You have now finished setting your default printer.

After you have returned to the Print Setup window, you can test your default printer by clicking Print Test Page.


Set Printer Properties for Your Default Printer

Printer properties that you can change include the following:

To change printer properties for your default printer, follow these steps:

  1. Select File [arrow] Print Setup and choose Properties. The Printer Properties window appears.

    Alternatively, you can issue the DMPRTPROPS command.

  2. From the Printer Properties window, select the tab that contains the information that you need to modify.

    • In the Name tab, you can modify the printer name and the printer description.

      Printer Properties Window Displaying Name Tab

      [Printer Properties Window Displaying Name Tab]

    • The Destination tab enables you to designate the device type, destination, and host options for the printer. See Sample Values for the Device Type, Destination, and Host Options Fields for examples.

      Printer Properties Window Displaying Destination Tab

      [Printer Properties Window Displaying Destination Tab]

    • The Font tab controls the available font options. The selections available in the drop-down boxes are printer specific. The font size is in points.

      Note:   This window enables you to set attributes for the default fonts. Typically, procedure output is controlled by the fonts specified by the ODS style or by program statements that specify font attributes.  [cautionend]

      Printer Properties Window Displaying Font Tab

      [Printer Properties Window Displaying Font Tab]

    • The Advanced tab lists the Resolution, Protocol, Translate table, Buffer size, Previewer, and Preview command options for the printer. The information in the drop-down fields is printer specific.

      Printer Properties Window Displaying Advanced Tab

      [Printer Properties Window Displaying Advanced Tab]

      Resolution

      specifies the resolution for the printed output in dots per inch (dpi).

      Protocol

      provides the mechanism for converting the output to a format that can be processed by a protocol converter that connects the EBCDIC host mainframe to an ASCII device. Protocol is required in the z/OS operating environment, and if you must use one, select one of the protocol converters that are listed.

      Translate table

      manages the transfer of data between an EBCDIC host and an ASCII device. Normally, the driver selects the correct table for your locale; the translate table needs to be specified only when you require nonstandard translation.

      Buffer size

      controls the size of the output buffer or record length. If the buffer size is left blank, a default size will be used.

      Previewer

      specifies the Previewer definition to use when Print Preview is requested. The Previewer box contains the previewer application that you have defined. See Define a New Previewer.

      Preview command

      is the command that will be used to open an external printer language viewer. For example, if you want Ghostview as your previewer, type ghostview %s . When a Preview Command is entered into a Printer definition, the printer definition becomes a previewer definition. The Preview Command must a valid command. When the command is executed as part of the preview process the %s will be replaced with the name of a temporary file that contains the input for the preview command.

    Note:   The Previewer and Preview Command fields are mutually exclusive. When you enter a command path into the Preview Command field, the Previewer box will appear dimmed.  [cautionend]


How to Specify a Printer for Your Session

The PRINTERPATH= system option enables you to specify a Universal Printer to use for the current SAS session. This printer specification is not retained across SAS sessions. The PRINTERPATH= system option is primarily used in batch mode, when there is no windowing environment in which to set the default printer. This option accepts a character string as its value--for example:

options printerpath=myprinter;
options printerpath="Print PostScript to disk";

Note:   If the printer name contains blanks, you must enclose it in quotation marks.  [cautionend]

You can get a list of valid character strings from two places:

You can also override the printer destination by specifying a fileref with the PRINTERPATH= system option:

options printerpath= (myprinter printout);
filename printout ...;


Printing with Universal Printing


Print a Test Page

To print a test page, follow these steps:

  1. Select File [arrow] Print Setup and choose Print Test Page to open the Print Setup window.

  2. Select the printer for which you would like a test page from Printer listview.

  3. Click Print Test Page.

Alternatively, you can issue the DMPRINTSETUP command.


Print the Contents of an Active SAS Window

To print the contents of a window in SAS, follow these steps:

  1. Click inside the window to make it active.

  2. Select File [arrow] Print. A print window appears. Your print window might differ from the window that follows.

    Alternatively, you can issue the DMPRINT command.

    Print Window

    [Print Window]

  3. If the Use Forms check box is visible, clear it in order to use Universal Printing.

  4. From the Printer group box, select the name of the printer definition.

  5. Enter the number of copies that you want.

  6. If you want to save your print job to a file,

    1. Select Print to File.

    2. Select OK. The File Selection window appears.

    3. Select an existing file or enter a new filename.

    Note:   If you print to an existing file, the contents of the file are either overwritten or appended, depending on whether you choose replace or append from the print window that is open. Most viewers for GIF, PDF, SVG, and PNG will not view appended files. When append is selected, a merged PDF is not produced.  [cautionend]

  7. Set additional printing options.

    The fields in the Page Options area provide choices according to the content in the SAS window that you are trying to print. By default, SAS prints the entire contents of the selected window.

    Page Options
    Item to Print Do This
    Selected lines of text in a window

    Note: not available on z/OS

    Select the text that you want to print, and then open the Print window. In the Page Options box, check the Print Selected Text box.
    The page that is currently displayed in the window Select Current page.
    A range of pages or other individual pages Select Range and enter the page numbers in the Pages field. Separate individual page numbers and page ranges with either a comma (,) or a blank. You can enter page ranges in any of these formats:
    • n-m prints all pages from n to m, inclusive.

    • -n prints all pages from page 1 to page n.

    • n- prints all pages from page n to the last page.

    In color Check the Print Color box.
    Line numbers Check the Print Line Numbers box.
    Page numbers Check the Print Page Numbers box.
    A graph Use the DMPRINT command, or select File [arrow] Print. Verify that the Use SAS/GRAPH Drivers check box is deselected in order to use Universal Printing.

  8. Click OK to print.


Working with Previewers


Define a New Previewer

Previewers enable you to preview a print job. SAS does not set a default previewer application. To use the Print Preview feature in SAS, you or your system administrator must first define a previewer for your system.

Operating Environment Information:   Print Previewers are not supported on z/OS.  [cautionend]

Previewers can be defined using the New Previewer wizard. To use the New Previewer wizard to define a new print previewer, follow these steps:
  1. Issue the DMPRTCREATE PREVIEWER command. The following window appears:

    Previewer Definition Window to Enter Name and Description

    [Previewer Definition Window to Enter Name and Description]

  2. Enter the name and a description for the new previewer (127 character maximum, no backslashes).

  3. Click Next to proceed to Step 2 of the wizard.

    Previewer Definition Window to Enter Previewer Language

    [Previewer Definition Window to Enter Previewer Language]

  4. Select the printer model that you want to associate with your previewer definition. The PostScript, PCL or PDF language generated for the model must be a language that your external viewer package supports. For best results, select the generic models such as PostScript Level 1 (Color) or PCL 5.

  5. Click Next to proceed to Step 3 of the wizard.

    Previewer Definition Window to Enter Command to Open Previewer Application

    [Previewer Definition Window to Enter Command to Open Previewer Application]

  6. Enter the command or commands used to open the previewer application, followed by %s where you would normally put the input filename. For example, if the command for starting your previewer is "ghostview," then you would type ghostview %s in the text field.

    You can pre-populate or seed a list of commands used to invoke a print preview application. For more information, see Seeding the Print Previewer Command Box.

    Note:   The %s can be used as many times as needed in the commands for starting the viewer. However, the start command needs to be the fully qualified command if it is not in the machine's command path.  [cautionend]

  7. Click Next to proceed to Step 4 of the wizard.

    Previewer Definition Window to Complete Process

    [Previewer Definition Window to Complete Process]

  8. Click Previous to correct any information. Click Finish when you have finished defining your default previewer.

The newly defined previewer will display a previewer icon in the Print Setup window.

Print Setup Window Displaying New Previewer

[Print Setup Window Displaying New Previewer]

This previewer application can be tested with the Print Test Page button on the Print Setup window.


Seeding the Print Previewer Command Box

Print Preview is supported by print previewer applications such as Ghostview, gv, and Adobe Reader. The Preview command box that appears in the Previewer Definition wizard (Previewer Definition Window to Enter Command to Open Previewer Application) and on the Advanced tab of the Printer Properties window (Printer Properties Window Displaying Advanced Tab) can be prepopulated or seeded with a list of commands. These commands are used to invoke print previewer applications that are available at your site. Users and administrators can manually update the registry, or define and import a registry file that contains a list of previewer commands. This is an example of a registry file.

[CORE\PRINTING\PREVIEW COMMANDS]
 "1"="/usr/local/gv %s"
 "2"="/usr/local/ghostview %s"


Previewing Print Jobs

You can use the print preview feature if a print viewer is installed for the designated printer. Print Preview is always available from the File menu in SAS. You can also issue the DMPRTPREVIEW command.


Set Page Properties

For your current SAS session, you can customize how your printed output appears in the Page Setup window. Depending on which printer you have currently set, some of the Page Setup options that are described in the following steps might be unavailable.

To customize your printed output, follow these steps:

  1. Select File [arrow] Page Setup. The Page Setup window appears.

    Alternatively, you can issue the DMPAGESETUP command.

  2. Select a tab to open windows that control various aspects of your printed output. Descriptions of the tabbed windows follow.

The Page Setup window consists of four tabs: General, Orientation, Margins, and Paper.

Note:   Page settings are stored in the SAS registry. Although your page settings should remain in effect from one SAS session to another, changing default printers could lose, change, or disable some of the settings. If you change printers during a SAS session, check the Page Setup window to ensure that all of your settings are valid for your new default printer.  [cautionend]

Previous Page | Next Page | Top of Page