Using Universal Printing in the Windowing Environment

Setting the Default Printer

A default printer is required for Universal Printing. Unless you define a default printer, SAS uses a predefined default printer that generates output in PostScript Level 1 language with a 12-point Courier font.
On z/OS, output goes by default to a sequential data set called <prefix>.SASPRT.PS where <prefix> is the value of the SYSPREF= SAS option.

Defining a New Printer Interactively

To create a new printer definition interactively:
  1. Select Filethen selectPrint Setup.
    Or, issue the command DMPRTSETUP.
  2. Select Newthen selectPrinter
    The first of four Define a New Printer dialog boxes is displayed. Fill out the fields in these dialog boxes to complete your new printer definition. Alternatively, you can issue the command DMPRTCREATE PRINTER to start the Define a New Printer dialog box directly.
    Note: The Define a New Printer dialog box does not prompt you for printer detail fields, including the Protocol and Translate Table (TRANTAB) fields. The printer details are automatically initialized to the details in the prototype that you select. When the Define a New Printer dialog boxes are complete, you are returned to the Printer Setup window with the new printer highlighted.
Follow these steps if you need to change any of the printer detail fields:
  1. Select Properties.
  2. Select Advanced.
  3. Change the values of Protocol and Translate Table as necessary.
  4. Select OK.
For further details about values for Protocol and Translate Table, see Setting Up Printers in Your Environment.

Changing the Default Printer

You can use any of the following procedures to change the default printer:
  • Use the Print Setup window.
    1. Select Filethen selectPrint Setup.
      Or, issue the command DMPRTSETUP.
    2. Select the printer that you want to use as the default.
    3. Select OK.
  • Issue the command DMSETPRINT <'printer-name'>, where <'printer-name'> is the name of the printer that you want to set as the default.
  • Submit the statement OPTIONS PRINTERPATH=('printer-name' <fileref> ). For more information about the PRINTERPATH option, see The PRINTERPATH SAS Option.
    Note: DMPRTSETUP and DMSETPRINT generate an entry in the SASUSER library, and they remain in effect until they are changed. Setting a default printer with the OPTIONS PRINTERPATH= command does not generate an entry in the SASUSER library. It remains in effect for the duration of the session only.

Setting Printer Properties

Use the following procedure to set the properties for a printer:
  1. Select Filethen selectPrint Setup.
    Or, issue the command DMPRTSETUP.
  2. From the Printer list box, select a printer.
  3. Select Properties.
  4. In the Printer Properties window, select the Destination tab to set the device type, destination, and host options.
    Device Type
    refers to the type of device to which your output is routed, such as a printer or a disk.
    Destination
    refers to the target location used by the device.
    Host Options
    includes any host-specific options that you can set for the selected device type.
  5. (Optional) Select Advanced to set resolution, protocol, translate table, buffer size, previewer, and preview command information for the printer.
    Resolution
    specifies the resolution to use for printed output in dots per inch.
    Protocol
    specifies how to convert the output to a format that can be processed by a protocol converter that connects the mainframe to an ASCII device. Protocol information is applicable only to IBM hosts.
    Translate Table
    specifies the translate table to use for generating your printed output. A translate table is needed when an EBCDIC host sends data to an ASCII device.
    Buffer Size
    refers to the buffer size to use when sending output to the printer.
    Previewer
    refers to the name of the viewer that is used when a print preview occurs. This option is not used in mainframe environments.
    Preview Command
    specifies a preview command for your previewer. This option is not used in mainframe environments.
  6. (Optional) Select Font to open a window where you can set the default font information for your printer.
    Note: Printer properties are stored in the SASUSER library and remain in effect until changed. For information about the way printer properties are used in the mainframe environment, see Setting Up Printers in Your Environment.

Changing the Default Font

The font included in the definition of the current default printer is the font used to generate output, unless you override it with the SYSPRINTFONT= system option. SYSPRINTFONT= sets the font to use when printing to the current default printer or to the printer identified with the optional keywords NAMED or ALL. You can specify SYSPRINTFONT= in your configuration file, at SAS invocation, or in an OPTIONS statement.
The syntax is as follows:
SYSPRINTFONT=(face-name <weight> <style> <character-set> <point-size>
<NAMED printer-name | DEFAULT | CHOICE>)
face-name
specifies the name of the font face to use for printing. This value must be a valid font face name. If the face-name consists of more than one word, it must be enclosed in single or double quotation marks. Valid font face names are listed in the Printer Properties window under the Font tab.
weight
specifies the weight of the font, such as bold. A list of valid values for your specified printer appears in the Printer Properties window. The default value is NORMAL.
style
specifies the style of the font, such as italic. A list of valid values for your specified printer appears in the Printer Properties window. The default is REGULAR.
point-size
specifies the point size to use for printing. This value must be an integer. If you omit this argument, SAS uses the default point size.
character-set
specifies the character set to use for printing. Valid values are listed in the Printer Properties window, under the Font tab. If the font does not support the specified character set, the default character set is used. If the default character set is not supported by the font, the font's default character set is used.
NAMED printer-name
must match exactly the name shown in the Print Setup window (except that the printer name is not case sensitive). If it is more than one word, the printer-name must be enclosed in double quotation marks.
DEFAULT
is the current default printer if you do not specify another printer.
ALL
updates the font information for all installed printers.

Setting Page Properties

  1. Select File then selectPage Setup.
    Or, issue the command DMPAGESETUP.
  2. From the Page Setup window, make selections that apply to the pages printed for the remainder of your SAS session or until the values are changed again through this window or through specification of options.
The selections that you can make in this window correspond to options that can be set by submitting an OPTIONS statement. These options are listed in the following table:
Options That Control Page Setup
General Options
Paper
Margins
Other
BINDING
PAPERDEST
TOPMARGIN
ORIENTATION
COLLATE
PAPERSIZE
RIGHTMARGIN
DUPLEX
PAPERSOURCE
LEFTMARGIN
COLORPRINTING
PAPERTYPE
BOTTOMMARGIN
Changes made by issuing the above options on an OPTIONS statement remain in effect for the current SAS session only. Changes made through the Page Setup window remain in effect for subsequent SAS sessions.
Options not supported by your default printer are dimmed and are not selectable.

Testing Printer Properties

  1. Select Filethen selectPrint Setup.
    Or, issue the command DMPRTSETUP.
  2. Select a printer from the Printer list box.
  3. Select Print Test Page.

Setting a Page Range Value

When you print the contents of an active window in the SAS windowing environment (such as the Program Editor or Log window), all pages are printed by default. In certain situations, the Print window includes a Page Range group box that you can use to control the page ranges that print.
  1. Select the appropriate SAS window.
  2. Select Filethen select Print.
    Or, issue the command DMPRINT.
  3. If the Page Range group box is available, select either All Pages, Current Page, or Select Range from the Range combo box. If you choose Select Range, then specify the pages that you want to print in the Pages field. You must separate individual pages or page ranges with either a comma or a blank space.
    n-m prints all pages from n to m (where n and m are both numbers).
    -n prints all pages from page 1 to n.
    n- prints all pages from page n to the last page.

Previewing a Print Job

You cannot preview a print job in the mainframe environment.

Printing Selected Text

You cannot print selected text in the mainframe environment.

Printing the Contents of a SAS Window

To print the contents of a SAS window with Universal Printing:
  1. Select the window that you want to print.
  2. Select Filethen selectPrint.
    Or, issue the command DMPRINT.
  3. If the Use Forms check box is visible, verify that it is not selected.
  4. From the Printer group box, select the appropriate printer name and the number of copies that you want to print.
    Note: If you choose to print multiple copies and Collation is turned off, each page prints the given number of times before the next page begins printing.
  5. Select or deselect additional Print window fields, if any additional fields are available.
    The fields that appear depend on the content that exists in the SAS window that you are trying to print. For example, if a window is active (such as the Program Editor), then the Page Range group box is available.
  6. Select the page range or specify the pages that you want to print.
For more information about printing the contents of a graphics window, see Printing the Contents of a Graphics Window.

Directing the Contents of a SAS Window to a File

  1. Select Filethen select Print.
    Or, issue the command DMPRINT.
  2. Select the Print to File check box in the Printer group box.
  3. Select OK.
    A window opens that enables you to save your contents to a specific filename. 
    • The filename must be fully qualified. Quotation marks are not needed, but you can use them.
    • If the file does not exist, you are asked if you want to create it, and if you want to delete it or catalog it. The file is created as a variable blocked (RECFM=VB) file.
    • If the file does exist, you are asked if you want to replace it or append to it.
    Note: The protocol and prototype properties of the selected printer definition are used to format the records that are written to the file. Thus, if you select a printer that has a protocol value of ASCII and a prototype value of PostScript Level 1 (Gray Scale), you generate a file that contains PostScript records written with the ASCII character set. To move this file to an ASCII platform, you must execute a Binary (FTP) transfer.

Printing the Contents of a Graphics Window

  1. Select the graphics window that you want to print.
  2. Select Filethen select Print.
    Or, issue the command DMPRINT.
  3. Select the appropriate printer name and the number of copies that you want to print from the Printer group box.
    Note: If you choose to print multiple copies and Collation is turned off, each page prints the given number of times before the next page begins printing.
  4. In the Print Method group box, verify that the Use SAS/GRAPH Drivers check box is not selected.

Creating Printer Definitions When Universal Printing Is Turned Off

You can create printer definitions with PROC PRTDEF when Universal Printing is turned off, but the printer definitions do not appear in the Print window. When Universal Printing is turned on, the menu options change to offer the Universal Printing options. When Universal Printing is turned off, the Universal Printing options are not available.
If you want to specify your printer definitions when Universal Printing is turned off, do one of the following:
  • Specify the printer definition as part of the PRINTERPATH SAS System option.
  • Submit the following statement:
    ODS PRINTER SAS PRINTER = myprinter;
    where myprinter is the name of your printer definition.

Universal Printing and the SAS Registry

Universal Printing printer definitions are stored in the SAS registry. To access the SAS registry:
  1. Select: Solutionsthen selectAccessoriesthen selectRegistry Editor.
    Or, issue the command REGEDIT.
  2. Select: Corethen selectPrintingthen selectPrinters
The printer definitions in SASUSER are listed first, followed by the printer definitions in SASHELP, along with all their options. You can modify any of the options for the printer definitions in SASUSER if you have permission to write to the SASUSER library. To modify the options:
Select: Editthen selectModify.
Or, click the right mouse button and select MODIFY.
CAUTION:
Making a mistake in editing the registry can cause your system to become unstable, unusable, or both.
Wherever possible, use the administrative tools, such as the New Library window, the PRTDEF procedure, Universal Print windows, and the Explorer Options window to make configuration changes, rather than editing the registry directly. Using the administrative tools ensures that values are stored properly in the registry when you change the configuration.
CAUTION:
If you use the Registry Editor to change values, you are not warned if any entry is incorrect. Incorrect entries can cause errors, and can even prevent you from bringing up a SAS session.