• Print  |
  • Feedback  |

FOCUS AREAS

Base SAS

Universal Printing in Version 8

This is preliminary documentation for Release 8.0 preproduction features. For the most current documentation, see the Universal Printing Web page.

Printing the Contents of an Active SAS Window

You can print the contents of an active SAS window in two ways:

  • Forms printing
  • Universal printing.

The following topics discuss Universal printing. Universal printing is available on every host except PCs. For more information on forms printing, see Printing with Forms.

To print the contents of an active SAS window:

  1. Select the appropriate window.
  2. Issue the DMPRINT command.
  3. From the Print… window, verify that the Use Forms checkbox is deselected.
  4. From the Printer group box, select the appropriate printer name and number of copies.

    Note: If you print multiple copies and Collation is turned off, each page prints the given number of times before the next page begins printing. For more details, see
    Setting Page Setup.
  5. From the Page Range group box, select the page range or pages that you want to print.
  6. Select OK.

See Also:

 

Printing the Contents of an Active SAS Window with Forms

  1. Select the appropriate window.
  2. Issue the DMPRINT command to open the Print… window.
  3. Select the Use Forms check box.
  4. Enter the spool command and the system printer name in the appropriate fields.

    The spool command value entered is saved as the value of the PRINTCMD option. The system printer name value is saved as the value of the SYSPRINT option.
  5. Select OK.

 

Setting the Universal Printing Destination

A default printer is required for Universal printing. SAS uses a predefined default printer which will generate output in PostScript Level 1 language with a 12 point courier font to a file called sasprt.ps in the current directory.

To changed the default printer, you can set up a new printer definition and set that printer definition as the default. Multiple printer definitions can be set. Printer definitions can also be set up interactively or by using PROC PRTDEF.

Setting a New Printer Definition

  1. Issue the DMPRTSETUP command.
  2. Select New. The Define a New Printer wizard begins. Fill out the fields on the four windows of this wizard to complete your new printer definition.

Note: You can also set new printer definitions with PROC PRTDEF.

Using the Define a New Printer Wizard

This wizard includes four window that step you through the process of creating a new printer definition.

On the first window, enter a descriptive name for the new printer. You may enter up to 256 characters. Select Next to move to the next wizard window.

On the second window, select the printer that most closely matches (or actually matches) the printer that you want to use. Select Previous to move to the prior window or Next to move to the next wizard window.

On the third window, set the Device Type, Destination, and Host Options fields. Device Type refers to the type of device to which your output will be routed, such as a printer or a disk. Destination refers to the target location used by the device. Host Options include any host-specific options that you can or want to set for the selected device type.

See also: Populating the Destination List

Select Previous to move to the prior window or Next to move to the next wizard window.

On the fourth window, select Finish to complete the wizard. Note: Your new printer definition becomes the default printer definition that is used when you print the contents of an active window using Universal printing. To change the default printer, see Setting the Default Printer.

 

Setting the Default Printer

  1. Issue DMPRTSETUP.
  2. In the Printer list box, select the printer that you want to use by default.
  3. Select OK.

The PRINTERPATH option also allows the user to temporarily set the default printer. PRINTERPATH is primarily used in batch, when there is no DMS environment to set the default printer using the dialogs. This option accepts a character string as its value, for example:

   options printerpath="myprinter";

   options printerpath="Print PostScript to disk";

Valid character strings are from the list of defined printers for the user and saved in the registry.  

 

Setting Printer Properties

  1. Issue DMPRTSETUP.

    Note: You can also issue the DMPRINT command, and then select Properties… from the Printer group box. This method enables you to set printer properties for the default printer.
  2. From the Printer list box, select a printer.
  3. Select Properties.
  4. In the Printer Properties window, set the Device Type, Destination, and Host Options fields.

    Device Type refers to the type of device to which your output will be routed, such as a printer or a disk. Destination refers to the target location used by the device. Host Options include any host-specific options that you can or want to set for the selected device type. See also:
    Populating the Destination List
  5. (Optional) Select Advanced to open a window where you can set resolution, translate table, and protocol 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. Resolution information pertains 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.
  6. (Optional) Select Font to open a window where you can set the default font information for the printer.

 

Testing Printer Properties

  1. Issue DMPRTSETUP.
  2. From the Printer list box, select a printer.
  3. Select Print Test Page.

 

Setting Page Setup

  1. Issue DMPRINT.
  2. Select Page Setup…
  3. From the Page Setup window, make selections that apply to pages printed from your current default printer. Any changes made on this window remain in effect for the current SAS session only.

    Many of the selections that you can make on this window correspond to options that can be set, such as PAPERSIZE, PAPERTYPE, PAPERSOURCE, PAPERDEST, TOPMARGIN, BOTTOMMARGIN, LEFTMARGIN, RIGHTMARGIN, ORIENTATION, DUPLEX, COLLATE, BINDING, COLORPRINTING.

Note: Options not supported by your default printer are grayed out and unavailable.

Note: You can also set page setup by issuing DMPAGESETUP to access the window…

 

Printing to a File

  1. Issue DMPRINT.
  2. In the Printer group box, select the Print to File check box.
  3. Select OK. A window opens that enables you to save the contents to a specific file.

 

Page Range Choices

When you print the contents of an active window, all pages are printed by default. You can control the page ranges that print, if needed.

  1. Select the appropriate SAS window.
  2. Issue the DMPRINT command.
  3. In the Page Range group box, select either the All Pages radio button or the Current Page radio button. Or, 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.

    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.
  4. Select OK.

 

Printing Selected Text

  1. Select the appropriate text from within an active SAS window.
  2. Issue the DMPRINT command.
  3. In the Page Range group box, select the Print Selected Text check box.
  4. Select OK.

 

Previewing your Print Job

Print Preview is not currently available.

 

Printing the Contents of an Active Graphics Window

  1. Select the appropriate graphics window.
  2. Issue the DMPRINT command.
  3. From the Printer group box, select the appropriate printer name and the number of copies you want to print.

    Note: If you print multiple copies and Collation is turned off, each page prints the given number of times before the next page begins printing. For more details, see Page Setup??
  4. In the Print Method group box, verify that the Use SAS/GRAPH Drivers check box is deselected.
  5. Select OK.

    This method of printing graphics uses the default printer’s attributes. If you instead want to use SAS/GRAPH drivers for printing, select the Use SAS/GRAPH Drivers check box from within the Print Method group box. Next, select an appropriate driver from the Driver field.

See Also:

 

Populating Destination and Host Options Lists

You can customize the values of the Printer Properties window’s Destination and Host Options fields. These values are populated from the registry, which can be seeded with a batch job.

To invoke the batch job to seed these fields, run PROC REGISTRY. For example, with the following sample job called routeinfo.sasxreg, you would run:

proc registry import='/u/location/of/routeinfo.sasxreg'; run;

The following job would seed the Destination field with "prn.ps" and "prn.pcl" and the Host Options field with "mod" when "Disk" is selected in the device box. If "email" is selected in the Device field, the Destination field will contain "josmit", "suwong", "mijone", and "anchav", and so on.

#---------------------------------------------------------------------#
# Copyright (c) 1999 by SAS Institute Inc, Cary NC 27513 USA          #
#                                                                     #
# NAME:     routeinfo.sasxreg                                         #
# TYPE:     SAS Route Output to: Destination population               #
#---------------------------------------------------------------------#
[CORE\PRINTING\DESTINATIONS\Disk]
"PostScript" = "prn.ps"
"PCL" = "prn.pcl"
[CORE\PRINTING\DESTINATIONS\DISK\OPTIONS]
"Append" = "mod"
"Replace" = ""
[CORE\PRINTING\DESTINATIONS\EMAIL]
"Joe Smith" = "josmit"
"Susan Wong" = "suwong"
"Mike Jones" = "mijone"
"Ann Chavez" = "anchav"
[CORE\PRINTING\DESTINATIONS\CATALOG]
"My SAS Catalog Entry" = "mine"
"Your SAS Catalog Entry" = "yours"
[CORE\PRINTING\DESTINATIONS\FTP]
"File Transfer Location" = "vivace"
"Another Location" = "puck"
[CORE\PRINTING\DESTINATIONS\PIPE]
"HP LaserJet 5si" = "nlp -dchpljr23"
"Tektronix 340" = "nlp -dctpxr21"
[CORE\PRINTING\DESTINATIONS\PLOTTER]
"HP7550" = "hp7550.hpgl"
[CORE\PRINTING\DESTINATIONS\PRINTER]
"HP DeskJet 720C" = "LPT1"
[CORE\PRINTING\DESTINATIONS\PRINTER\OPTIONS]
"A" = "SYSOUT=A"
"G" = "SYSOUT=G"
[CORE\PRINTING\DESTINATIONS\SOCKET}sprocket]
"Bogus Socket 1" = "sprocket1"
"Bogus Socket 2" = "sprocket2"
[CORE\PRINTING\DESTINATIONS\TAPE]
"Drive 100" = "100"
"Drive 101" = "101"

Setting up Printers using PROC PRTDEF

Printer definitions can be created in batch mode for an individual or for all SAS users at your site using PROC PRTDEF. The system administrator can create printer definitions in the registry and make these printers available to all SAS users at your site by using PROC PRTDEF with the LIBRARY=SASHELP option. The complete syntax of PROC PRTDEF is as follows:

PROC PRTDEF [options(s)];

where options are:

DATA =

Specifies the input dataset containing the printer definition records. Printer definitions data records are required to have 5 columns of data which represent the printer name, prototype, device, destination, and host options.

  • printer name

The name will be associated with the rest of the attributes specified with its printer definition data record. The name is limited to 256 characters and is case sensitive. If a record contains a name that already exists, the record will not be processed.

  • prototype

For a valid list of prototypes or model descriptions look in the SAS Registry Editor, which can be invoked with regedit, under CORE, PRINTING, PROTOTYPES or bring up the DMPRTSETUP dialog and press the New... button and view the list in Step 2 of the Printer Definition wizard. The prototype is case sensitive.

  • device

Valid devices are listed in step 3 of the Printer Definition wizard and in the SAS Registry Editor under CORE, PRINTING, DEVICE TYPES. The device column is not case sensitive.

  • destination

The destination is limited to 256 characters.

  • host options

The host options column is not case sensitive. The host options are limited to 256 characters.

LIBRARY = [SASHELP | SASUSER]

Specifies whether the printer definitions are available to all users or just the user running PROC PRTDEF. The SASHELP library will make the definitions available to all users. You must have permission to write to the SASHELP catalog for LIBRARY=SASHELP to work.

data printers;
  input  name $ 1-22 model $ 23-43 device $ 44-50 dest $ 51-62 hostopt $ 65-70;
cards;
MyPrinter             PostScript Level 1   DISK   sasprt.ps     mod
Joe's Printer         PCL 5 Printer        DISK   sasprt.pcl    mod
Howard's Printer      PostScript Level 2   DISK   sasprt2.ps    replace
;
proc prtdef data=printers library=sashelp;
run;

Sample PROC PRTDEF job

The printers that have been defined will be displayed in the Printer Setup dialog. All PROC PRTDEF defined printers will be displayed in the Printer name list. The printer definitions can also be seen in the regedit window under CORE, PRINTING, PRINTERS. EF="#Adding New Prototypes"Adding New Prototypes

Note: If the end user modifies and saves new attributes on an adiministrator defined printer, the printer will become a user defined printer with any values specified by the user overriding those set by the administrator. If the user defined printer definition is removed, the administator defined printer will reappear.