Chapter Contents

Previous

Next
The ODS Statements

ODS PRINTER Statement


Opens, manages, or closes the Printer destination. If the destination is open, you can create Printer output (output that is formatted for a high-resolution printer).

ODS PRINTER <action>;
ODS PRINTER <option(s)>;

To do this ... Use this action
Close the Printer destination and the file that is associated with it CLOSE
Select output objects for the Printer destination SELECT
Exclude output objects from the Printer destination EXCLUDE
Write to the SAS log the current selection or exclusion list for the Printer destination SHOW

To do this ... Use this option
Specify whether or not to use all the color information that the style definition provides COLOR=
Specify the file to write to FILE=
Specify a scaling factor to apply to all the font sizes that do not have an explicit unit of measure FONTSCALE=
Specify that ODS use the generic postscript driver that SAS provides POSTSCRIPT
Specify the name of the printer for which to format the Printer output. PRINTER=
Specify that ODS use the printer drivers that SAS provides SAS
Specify the style definition to use in writing the Printer output STYLE=
Ensure the uniformity of column widths for all pages of Printer output UNIFORM


Without an Action or Options

If you use the ODS PRINTER statement without an action or options, it opens the Printer destination.


Actions

An action takes some action regarding selection and exclusion lists, or closes the Printer destination. action can be one of the following:

CLOSE
closes the Printer destination and the file that is associated with it. You cannot print the file until you close the destination.

When an ODS destination is closed, ODS does not send output to that destination. Closing an unneeded destination frees some system resources.
Featured in: Selecting Output for the HTML and Printer Destinations

EXCLUDE exclusion(s) | ALL | NONE
excludes output objects from the Printer destination.
Restriction: The Printer destination must be open for this action to take effect.
See also: ODS EXCLUDE Statement

SELECT selection(s) | ALL | NONE
selects output objects for the Printer destination.
Restriction: The Printer destination must be open for this action to take effect.
See also: ODS SELECT Statement

SHOW
writes to the SAS log the current selection or exclusion list for the Printer destination. If the list is the default list (SELECT ALL), SHOW also writes the current overall selection or exclusion list.
Restriction: The Printer destination must be open for this action to take effect.


Options

COLOR=YES | NO
specifies whether or not to use all the color information that the style definition provides. In order to actually print in color, you must also

If COLOR=NO, the Printer destination generates black and white output. It renders all text and rules in black, and it ignores all specifications for a background color from the style definition except for the purposes of determining whether to print rules for the table.
Alias: COLOR | NOCOLOR
Default: The default is determined by the value of "Use Color" in the ODS/PRINTER subkey in the SAS registry. If the value of "Use Color" is 0, ODS generates black and white Printer output by default. If the value of "Use Color" is 1, ODS generates color Printer output by default. By default, the value of "Use Color" is 1.
Tip: If you print color output on a printer that does not support color, your output may be difficult to read.

FILE=file-specification
specifies the file to write to. file-specification can be one of the following:

'external-file'
is the name of an external file to write to.

fileref
is a fileref that has been assigned to an external file. Use the FILENAME statement to assign a fileref. (For information on the FILENAME statement, see the section on statements in SAS Language Reference: Dictionary.)

Default: If you do not specify a file to write to, ODS writes to the file that is specified by one of two SAS system options:

  • SYSPRINT= (if you are using the Windows operating environment and do not specify the SAS option in the ODS PRINTER statement).

  • PRINTERPATH= (in all other cases)

If the system option does not specify a file, ODS writes to the default printer (see the discussion of PRINTER=).
Featured in: Selecting Output for the HTML and Printer Destinations

FONTSCALE=percent
specifies a scaling factor to apply to all the font sizes that do not have an explicit unit of measure. Most style definitions that SAS Institute provides specify the font size as an integer between 1 and 7. These integers are the only font-size specifications that are recognized by all the browsers that SAS supports. The Printer destination must arbitrarily select a font size for each integer. The FONTSCALE= option allows you to adjust the size as you wish.
Default: 100

POSTSCRIPT
specifies that ODS use the generic postscript driver that SAS provides.
Alias: PS
Tip: Specifying this option is equivalent to specifying both the SAS option and PRINTER=POSTSCRIPT.

PRINTER=printer-name
specifies the name of the printer for which to format the Printer output. printer-name must match a subkey in the registry. If you are using the SAS printer drivers, you can find a description of the printer, which includes its destination and device type, in

CORE
[arrow]
PRINTING
[arrow]
PRINTERS
[arrow]
printer
[arrow]
PRINTER SETUP
[arrow]
OUTPUT

If you are using the Windows operating environment and you do not specify the SAS option in the ODS PRINTER statement, a description of the printer is in the Windows registry.

Note:   printer-name is not necessarily a physical printer. It could, for instance, be a file on the disk.  [cautionend]
Alias: PRT
Default: If you do not specify a printer, ODS formats the Printer output for the printer that is specified by one of two SAS system options:

  • SYSPRINT= (if you are using the Windows operating environment and do not specify the SAS option in the ODS PRINTER statement)

  • PRINTERPATH= (in all other cases).

If the system option does not specify a printer, ODS writes to the default printer driver, as specified in the SAS registry or the Windows registry. In the SAS registry, the default printer is specified in

CORE
[arrow]
PRINTING
[arrow]
Default Printer

Tip: To see a list of available printers for SAS printing, use the REGEDIT command. The printers are listed in the Registry Editor window under

CORE
[arrow]
PRINTING
[arrow]
PRINTERS

SAS
specifies that ODS use the printer drivers that the SAS system provides.
Default: By default, when ODS is running in the Windows operating environment, it uses the printer drivers that the operating environment provides.
Restriction: This option is effective only in the Windows operating environment.

STYLE=style-definition
specifies the style definition to use in writing the printer output. For more information, see Style Definitions, Style Elements, and Style Attributes.
Default: If you do not specify a style definition, ODS uses the style definition that is specified in the SAS registry subkey

ODS
[arrow]
PREFERENCES
[arrow]
PRINTER
[arrow]
Selected Style
By default, this value specifies styles.printer.

UNIFORM
ensures the uniformity of column widths for all pages of Printer output. When the UNIFORM option is in effect, ODS reads the entire table before it starts to print it so that it can determine the column widths that are necessary to accommodate all the data. It uses these column widths on all pages.
Default: If you do not specify UNIFORM, ODS prints a table one page at a time. This approach ensures that SAS does not run out of memory while processing very large tables. However, it can also mean that column widths vary from one page to the next.
Tip: The UNIFORM option may cause SAS to run out of memory if you are printing a very large table. If this happens, you can explicitly set the width of each of the columns in the table and let the table print one page at a time. To do so, you must edit the table definition that you use (see EDIT Statement).


Chapter Contents

Previous

Next

Top of Page

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