ODS PRINTER Statement

Opens, manages, or closes the PRINTER destination, which produces printable output.
Valid in: Anywhere
Category: ODS: Third-Party Formatted
Interaction: By default, when you execute a procedure that uses the FORMCHAR system option (for example, PROC PLOT or PROC CHART), ODS formats the output in SAS Monospace font. If you are creating output that will be viewed in an operating environment where SAS software is not installed, this output will not display correctly. This is because without SAS, the SAS Monospace font is not recognized. To make your document display correctly, include the following statement before your SAS program:
OPTIONS FORMCHAR="|----|+|---+=|-/\<>*";
CAUTION:
For PostScript output, verify that your online viewer or printer is set to use the same paper size as the value that is specified by the OPTIONS PAPERSIZE= statement. Otherwise, some parts of your output might appear to be missing.

Syntax

ODS PRINTER <(<ID=> identifier)> < action> ;
ODS PRINTER <(<ID=> identifier)> <option(s)> ;

Summary of Optional Arguments

Open multiple instances of the same destination at the same time
Specify the root name for the anchor tag that identifies each output object in the current file
Insert the text string that you specify as the author into the metadata of a file
Specify a string to use as the first part of all references that ODS creates in the file
Control the generation of bookmarks in PDF and PS files
Specify whether to generate and display the list of bookmarks for PDF and PS files
Close the destination and the file that is associated with it
Apply a specified color scheme to your output
Specify the number of columns to create on each page of output
Specify the compression of a PDF file. Compression reduces the size of the file
Control the generation of a printable table of contents
Specify a cascading style sheet to apply to your output
Specify the image resolution in dots per inch for output images
Exclude output objects from the destination
Specify the file to write to
Specify the location where footnotes are printed in the graphics output
Control the location where titles are printed in the graphics output
Use the printer drivers that the host system provides
Insert a string of keywords into the output file's metadata
Create a new file at the specified starting-point
Omit the table of contents (Bookmark list) that is produced by default when producing PDF or PDFMARK output
Specify that the output from the destination be added to an ODS package
Create PCL output
Create PDF output
Insert special markup which is used when converting a PostScript file to a PDF file
Control whether notes are added to a PDF file for items that are associated with the FLYOVER= style attribute
Control the level of the expansion of the table of contents in PDF documents
Create output that is formatted for the specified printer
Create PostScript output
Select output objects for the destination
Write to the SAS log the current selection or exclusion list for the destination
Control page breaks
Specify the style definition to use in writing the PDF output
Insert the text string that you specify as the subject in the metadata of a file
Insert text into your output
Insert the text string that you specify as the title in the metadata of a file
For multi-page tables, provide uniformity from page to page within a single table

Without Arguments

When using the ODS PRINTER statement in UNIX or z/OS operating environments without an action or options, the PRINTER destination is opened and PostScript output is created unless otherwise configured by your system administrator.
If you use the ODS PRINTER statement in the Windows operating environment without an action or options, then it prints to the default Windows printer.

Actions

The following actions are available for the ODS PRINTER statement:

CLOSE
closes the destination and any files that are associated with it. For Printer destinations, you cannot print the file until you close the destination.
Tip:When an ODS destination is closed, ODS does not send output to that destination. Closing an unneeded destination conserves system resources.
EXCLUDE exclusion(s)| ALL | NONE
excludes one or more output objects from the destination.
Default:NONE
Restriction:A destination must be open for this action to take effect.
SELECT selection(s) | ALL | NONE
selects output objects for the specified destination.
Default:ALL
Restriction:A destination must be open for this action to take effect.
SHOW
writes the current selection list or exclusion list for the destination to the SAS log.
Restriction:The destination must be open for this action to take effect.
Tip:If the selection or exclusion list is the default list (SELECT ALL), then SHOW also writes the entire selection or exclusion list. For information about selection and exclusion lists, see Selection and Exclusion Lists.

Optional Arguments

ANCHOR='anchor-name'
specifies the root name for the anchor tag that identifies each output object in the current file.
Each output object must have an anchor tag for the bookmarks to reference. The references, which are automatically created by ODS, point to the name of an anchor. Therefore, each anchor name in a file must be unique.
anchor-name
is the root name for the anchor tag that identifies each output object in the current file.
ODS creates unique anchor names by incrementing the name that you specify. For example, if you specify ANCHOR='TABULATE', then ODS names the first anchor tabulate. The second anchor is named tabulate1; the third is named tabulate2, and so on.
Requirement:You must enclose anchor-name in quotation marks.
Alias:NAMED_DEST= | BOOKMARK=
Restriction:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and the ODS PRINTER statement with the PDFMARK option specified.
Tips:You can change anchor names as often as you want by submitting the ANCHOR= option in a valid statement anywhere in your program. After you have specified an anchor name, it remains in effect until you specify a new one.

Specifying new anchor names at various points in your program is useful when you want to link to specific parts of your PRINTER output. Because you can control where the anchor name changes, you know in advance what the anchor name will be at those points.

AUTHOR= 'author-text'
inserts the text string that you specify as the author into the metadata of a file.
author-text
is the text in the metadata of an open file that indicates the author.
Restrictions:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and the ODS PRINTER statement with the PDFMARK option specified.

The AUTHOR= option takes effect only if specified at the opening of a file.

Requirement:You must enclose author-text in quotation marks.
BASE='base-text'
specifies the text to use as the first part of all references that ODS creates in the output file.
base-text
is the text that ODS uses as the first part of all references that ODS creates in the file.
Consider this specification:
BASE='http://www.your-company.com/local-url/'
In this case, ODS creates references that begin with the string http://www.your-company.com/local-url/. The appropriate anchor-name completes the link.
Restriction:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and the ODS PRINTER statement with the PDFMARK option specified.
Requirement:You must enclose base-text in quotation marks.
BOOKMARKLIST= HIDE | NONE | SHOW
specifies whether to generate and display the list of bookmarks for PDF and PS files.
HIDE
generates a list of bookmarks for your PDF and PS files. The bookmarks are not automatically displayed when you open the PDF and PS files.
NONE
specifies not to generate a list of bookmarks for your PDF and PS files.
Aliases:NO | OFF

NOBOOKMARKLIST is an alias for BOOKMARKLIST=NONE | NO | OFF.

SHOW
generates a list of bookmarks for your PDF and PS files. The bookmarks are automatically displayed when you open the PDF and PS files.
Aliases:YES | ON

BOOKMARKLIST is an alias for BOOKMARKLIST=SHOW | YES | ON.

Default:SHOW
Restrictions:This option can be set only when you first open the destination.

This option has an effect only when creating PDF, PDFMARK, PS output.

Interaction:The NOTOC option specifies BOOKMARKLIST= OFF and CONTENTS= OFF.
Note:The generation of the bookmarks is not affected by the setting of this option. Bookmarks are generated by the BOOKMARKGEN= option.
BOOKMARKGEN | NOBOOKMARKGEN | BOOKMARKGEN=
controls the generation of bookmarks in PDF and PS files.
BOOKMARKGEN
specifies to generate bookmarks in PDF and PS files.
BOOKMARKGEN=
controls the generation of bookmarks in PDF and PS files.
NO
specifies not to generate bookmarks in PDF and PS files.
Alias:OFF
YES
specifies to generate bookmarks in PDF and PS files.
Alias:ON
NOBOOKMARKGEN
specifies not to generate bookmarks in the PDF and PS files.
Default:YES or BOOKMARKGEN
Interaction:If you set BOOKMARKGEN=NO, then the BOOKMARKLIST option is set to NO also.
COLOR=FULL | GRAY | MONO | NO | YES
applies the specified color scheme to your output.
FULL
creates full color output for both text and graphics.
GRAY
creates gray scale output for both text and graphics.
Alias:GREY
MONO
creates monochromatic output for both text and graphics.
Alias:BW
NO
does not use all the color information that the style definition provides. If you specify COLOR=NO, then the destination does this:
  • generates black and white output
  • creates all text and rules in black
  • sets the SAS/GRAPH device to produce SAS/GRAPH output in gray scale
  • ignores specifications for a background color from the style definition except for the purposes of determining whether to print rules for the table
YES
uses all the color information that a style definition provides, including background color. In order to actually print in color, you must also do the following:
  • use a printer that is capable of printing in color.
  • use the COLORPRINTING SAS system option. For information about the COLORPRINTING system option, see SAS System Options: Reference.
Default:YES
Tip:If you choose color output for a printer that does not support color, then your output might be difficult to read.
COLUMNS=n
specifies the number of columns to create on each page of output.
n
is the number columns per page.
Default:1
COMPRESS=n
controls the compression of a PDF file. Compression reduces the size of the file.
n
specifies the level of compression. The larger the number, the greater the compression. For example, n=0 is completely uncompressed, and n=9 is the maximum compression level.
Default:6
Range:0–9
Restrictions:Use this option only with the ODS PDF statement and the ODS PRINTER statement with the PDF option specified. PostScript output cannot be compressed.

The COMPRESS= option takes effect only if specified at the opening of a file.

Interactions:The COMPRESS= option overrides the DEFLATION system option. First, the DEFLATION system option checked. Next, the ODS PDF statement COMPRESS= option is checked. If the COMPRESS= option is specified, that value is used regardless of the value specified for the DEFLATION system option. For more information, see the DEFLATION option.

The COMPRESS= option overrides the UPRINTCOMPRESSION option. If COMPRESS= is specified, the UPRINTCOMPRESSION system option is then queried. If the system option is off, it will be turned on for this one PDF statement and the PDF file will be compressed. When compression is complete, the UPRINTCOMPRESSION system option is again enabled for all other files to use. For more information, see the UPRINTCOMPRESSION system option.

CONTENTS= NO | YES
controls the generation of a printable table of contents.
NO
does not generate a printable table of contents.
Alias:NOCONTENTS is an alias for CONTENTS=NO.
YES
generates a printable table of contents.
Alias:CONTENTS is an alias for CONTENTS=YES.
CSSSTYLE='file-specification'<(<media-type-10>)>
specifies a cascading style sheet to apply to your output.
file-specification
specifies a file, fileref, or URL that contains CSS code.
file-specification is one of the following:
"external-file"
is the name of the external file.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:For information about the FILENAME statement, see SAS Statements: Reference.
"URL"
is a URL to an external file.
Requirement:You must enclose external-file in quotation marks.
(media-type-1<.. media-type-10>)
specifies one or more media blocks that corresponds to the type of media that your output will be rendered on. CSS uses media type blocks to specify how a document is to be presented on different media: on the screen, on paper, with a speech synthesizer, with a braille device, and so on.
The media block is added to your output in addition to the CSS code that is not contained in any media blocks. By using the media-type suboption, in addition to the general CSS code, you can import the section of a CSS file intended only for a specific media type.
Default:If no media-type is specified in your ODS statement, but you do have media types specified in your CSS file, then ODS uses the Screen media type.
Range:You can specify up to ten different media types.
Requirements:You must enclose media-type in parentheses.

You must specify media-type next to the file-specification specified by the CSSSTYLE= option.

Tip:If you specify multiple media types, all of the style information in all of the media types is applied to your output. However, if there is duplicate style information in different media blocks, then the styles from the last media block are used.
Requirement:CSS files must be written in the same type of CSS produced by the ODS HTML statement. Only class names are supported, with no IDs and no context-based selectors. To view the CSS code that ODS creates, you can do one of the following:
  • Specify the STYLESHEET= option.
  • View the source of the HTML file and look at the code between the <STYLE> </STYLE> tags at the top of the file.
Interaction:If both the STYLE= option and the CSSSTYLE= option are specified on an ODS statement, the option specified last is the option that is used.
See:For an example of a valid for ODS CSS file, see Applying a CSS File to ODS Output.
DPI=
specifies the image resolution for output files.
Default:The default is determined by the default DPI of the specified PRINTER= value or the PRINTERPATH option.
Restriction:The DPI= option takes effect only if specified at the opening of a file.
FILE='external-file' | fileref
specifies the file that contains the output.
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
Restriction:The FILE=fileref option cannot be used in conjunction with the NEWFILE= option.
See:For information about the FILENAME statement, see SAS Statements: Reference.
Default:If you do not specify a file to write to, then 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 any of the following options: PCL, PDF, PDFMARK, PS, or SAS.
PRINTERPATH= in all other cases.
If the system option does not specify a file, then ODS writes to the default printer. For more information, see the PRINTER= option.
Interaction:In an ODS printer family statement that refers to an open ODS PRINTER destination, the FILE= option forces ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
See:For information about the FILENAME statement, see SAS Statements: Reference.
GFOOTNOTE | NOGFOOTNOTE
controls the location of the footnotes that are defined by the graphics program that generates the Printer output.
GFOOTNOTE
includes all of the currently defined footnotes within the graphics output.
NOGFOOTNOTE
prevents all of the currently defined footnotes from appearing in the graphics file. Instead, they become part of the Printer file.
Default:GFOOTNOTE
Restriction:This option applies only to SAS programs that produce one or more device-based graphics, or graphics created by the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure.
See:For more information, see Customizing Titles and Footnotes.
GTITLE | NOGTITLE
controls the location of the titles that are defined by the graphics program that generates the Printer output.
GTITLE
includes all of the currently defined titles within the graphics output.
NOGTITLE
prevents all of the currently defined titles from appearing in the graphics output. Instead, the titles become part of the Printer file.
Default:GTITLE
Restriction:This option applies only to SAS programs that produce one or more device-based graphics, or graphics created by the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure.
See:For more information, see Customizing Titles and Footnotes.
HOST
specifies that ODS use the printer drivers that the host system provides.
Interaction:In an ODS printer family statement that refers to an open ODS PRINTER destination, the HOST option forces ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
(<ID=> identifier)
enables you to open multiple instances of the same destination at the same time. Each instance can have different options.
identifier
can be numeric or can be a series of characters that begin with a letter or an underscore. Subsequent characters can include letters, underscores, and numerals.
Restriction:If identifier is numeric, it must be a positive integer.
Requirement:The ID= option must be specified immediately after the destination name.
KEYWORDS='keywords-text'
inserts a string of keywords into the output file's metadata. The keywords enable a document management system to do topic-based searches.
keywords-text
is the string of keywords.
Restrictions:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and the ODS PRINTER statement with the PDFMARK option specified.

The KEYWORDS= option takes effect only if specified at the opening of a file.

Requirement:You must enclose keywords-text in quotation marks.
NEWFILE= starting-point
creates a new file at the specified starting-point.
starting-point
is the location in the output where you want to create a new file.
ODS automatically names new files by incrementing the name of the file. In the following example, ODS names the first file REPORT.PS. Additional body files are named REPORT1.PS, REPORT2.PS, and so on.
Example:
FILE= 'REPORT.PS'
starting-point can be one of the following:
BYGROUP
starts a new file for the results of each BY group.
NONE
writes all output to the file that is currently open.
OUTPUT
starts a new file for each output object. For SAS/GRAPH this means that ODS creates a new file for each SAS/GRAPH output file that the program generates.
Alias:TABLE
PAGE
starts a new file for each page of output. A page break occurs when a procedure explicitly starts a new page (not because the page size was exceeded) or when you start a new procedure.
PROC
starts a body file each time you start a new procedure.
Default:NONE
Restrictions:The NEWFILE= option cannot be used in conjunction with the FILE=fileref option.

The NEWFILE= option cannot be used if you are sending output to a physical printer.

Tips:If you end the filename with a number, then ODS begins incrementing with that number. In the following example, ODS names the first file MAY5.PS. Additional body files are named MAY6.PS, MAY7.PS, and so on.

Example:

FILE= 'MAY5.PS'

NOTOC
specifies that ODS omit the table of contents (Bookmark list) that is produced by default when producing PDF or PDFMARK output.
Interaction:The NOTOC option specifies BOOKMARKLIST=OFF and CONTENTS= OFF.
PACKAGE <package-name>
specifies that the output from the destination be added to a package.
package-name
specifies the name of a package that was created with the ODS PACKAGE statement. If no name is specified, then the output is added to the unnamed package that was opened last.
PCL
creates PCL output.
Restriction:Do not use this option in conjunction with the PDF or PS option.
Interaction:If you use the PCL option in an ODS PRINTER statement that refers to an open ODS PRINTER destination, the option will force ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
PDF
creates PDF output.
Restrictions:Do not use this option in conjunction with the PCL or PS options.

PDF does not support double-byte Type1 fonts.

Interaction:If you use the PDF option in an ODS PRINTER statement that refers to an open ODS PRINTER destination, the option will force ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
PDFMARK
enables ODS to insert special tags into a PostScript file. When you use software such as Adobe Acrobat (not Adobe Viewer), Acrobat Distiller interprets the tags to create a PDF file that contains the following items:
  • bookmarks for each section of the output and for each table.
  • references for items that are associated with the URL= style attribute.
  • notes for items that are associated with the FLYOVER= style attribute. Notes are optional, and are based on the PDFNOTE option.
  • author, keywords, subject, and title in the metadata of a file.
Default:Because using PDFMARK implies PostScript output, SAS automatically uses the PostScript driver that SAS supplies with this option.
Restriction:You cannot use the PRINTER= option with the PDFMARK option.
Requirement:To create a PDF file, you must use specialized software, such as Adobe Acrobat Distiller to convert the marked-up PostScript file into a PDF formatted file.
Interaction:In an ODS printer family statement that refers to an open ODS PRINTER destination, the PDFMARK option forces ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
Tip:Use this option only if you plan to distill the output. Otherwise, it uses excess resources and does not enhance the results.
PDFNOTE | NOPDFNOTE
controls whether notes are added to a PDF file for items that are associated with the FLYOVER= style attribute.
PDFNOTE
adds notes to a PDF file for items that are associated with the FLYOVER= style attribute.
NOPDFNOTE
modifies the behavior of PDFMARK so that notes are not added to the file for items that are associated with the FLYOVER= style attribute.
Default:PDFNOTE
Restriction:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and ODS PRINTER statement with the PDFMARK option specified.
PDFTOC=n
controls the level of the expansion of the table of contents in PDF documents.
n
specifies the level of expansion. For example, PDFTOC=0 results in a fully expanded table of contents, while PDFTOC=2 results in a table of contents that is expanded to two levels.
Default:0
Tip:The PDFTOC= can be set after the file has been opened, but only the last specification for a given file is used.
PRINTER= printer-name
creates output that is formatted for the specified printer.
printer-name
is the name of the printer for which you want output formatted.
Alias:PRT
Default:If you do not specify a printer, then 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 any of the following options: PCL, PDFMARK, POSTSCRIPT, PS, or SAS.
PRINTERPATH= in all other cases.
If the system option does not specify a printer, then 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 COREthen selectPRINTINGthen selectDefault Printer. In SAS 9.3, the default printer value can be modified in the SAS Registry. For information on how to change the default printer, see Changing SAS Registry Settings for ODS.
Restrictions:printer-name must match a subkey in either the SAS registry or the Windows printer registry.

You cannot use the PRINTER= option with the PCL, PDF, PDFMARK, or PS options.

Interaction:In an ODS printer family statement that refers to an open ODS PRINTER destination, the PRINTER= option forces ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
Note:printer-name is not necessarily a physical printer. It is a description that tells SAS how to format the output, and where the output is located. For example, it could be a file on a disk.
Tips:The description of the printer includes its destination and device type. If you are using the SAS printer drivers, then you can find a description of the printer in COREthen selectPRINTINGthen selectPRINTERSthen selectselected-printerthen selectPRINTER SETUPthen selectOUTPUT.

In the Windows operating environment, if you do not specify the SAS option in the ODS PRINTER statement, then a description of the printer is located in the Windows registry.

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

PS
creates PostScript output.
Alias:POSTSCRIPT
Restrictions:Do not use this option in conjunction with the PDF or PCL options.

PS does not support double-byte Type1 fonts.

Interaction:If you use the PS option in an ODS PRINTER statement that refers to an open ODS PRINTER destination, the option will force ODS to close the destination and all files that are associated with it, and to open a new instance of the destination. For more information, see Opening and Closing the PRINTER Destination.
Tip:Specifying this option is equivalent to specifying both the SAS option and PRINTER= POSTSCRIPT.
STARTPAGE=NEVER | NO | NOW | YES | BYGROUP
controls page breaks.
BYGROUP
specifies to insert page breaks after each BY group.
NEVER
specifies not to insert page breaks, even before graphics procedures.
CAUTION:
Each graph normally requires an entire page. The default behavior forces a new page after a graphics procedure. STARTPAGE=NEVER turns off that behavior, so specifying STARTPAGE= NEVER might cause graphics to overprint.
NO
specifies that no new pages be inserted at the beginning of each procedure, or within certain procedures, even if new pages are requested by the procedure code. A new page will begin only when a page is filled or when you specify STARTPAGE=NOW.
CAUTION:
Each graph normally requires an entire page. The default behavior forces a new page after a graphics procedure, even if you use STARTPAGE=NO. STARTPAGE=NEVER turns off that behavior, so specifying STARTPAGE= NEVER might cause graphics to overprint.
Alias:OFF
Tip:When you specify STARTPAGE=NO, system titles and footnotes are still produced only at the top and bottom of each physical page, regardless of the setting of this option. Thus, some system titles and footnotes that you specify might not appear when this option is specified.
NOW
forces the immediate insertion of a new page.
Tip:This option is useful primarily when the current value of the STARTPAGE= option is NO. Otherwise, each new procedure forces a new page automatically.
YES
inserts a new page at the beginning of each procedure, and within certain procedures, as requested by the procedure code.
Alias:ON
Default:YES
STYLE=style-definition
specifies the style definition to use in writing the printer output.
Default:If you do not specify a style definition, then ODS uses the style definition that is specified in the SAS registry subkey: ODSthen selectDESTINATIONSthen selectPRINTER. By default, this value is Printer for the PRINTER, PDF, and PS destinations and MonochromePrinter for the PCL destination.
See:For a complete discussion of style definitions, see Working with Styles .

For instructions on making your own user-defined style definitions, see TEMPLATE Procedure: Creating a Style Template.

SUBJECT='subject-text'
inserts into the metadata of a file the text string that you specify as the subject.
subject-text
is the text in the metadata of a file that indicates the subject.
Restrictions:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and the ODS PRINTER statement with the PDFMARK option specified.

The SUBJECT= option takes effect only if specified at the opening of a file.

Requirement:You must enclose subject-text in quotation marks.
TEXT='text-string'
inserts a text string into your output.
text-string
is the text that you want to insert into your output.
Requirement:You must enclose text-string in quotation marks.
Tip:If you are submitting more than one procedure step and you do not specify the STARTPAGE=NO option, each procedure will force a new page before the output. Therefore, any text that you specify with TEXT= will be on the same page as the previous procedure.
TITLE='title-text'
inserts into the metadata of a file the text string that you specify as the title.
title-text
is the text in the metadata of a file that indicates the title.
Restrictions:Use this option only with the ODS PDF statement, the ODS PS statement with the PDFMARK option specified, and the ODS PRINTER statement with the PDFMARK option specified.

The TITLE= option takes effect only if specified at the opening of a file.

Requirement:You must enclose title-text in quotation marks.
UNIFORM
for multiple page tables, ensures uniformity from page to page within a single table. 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. These column widths are applied to all pages of a multiple page table.
Default:If you do not specify the UNIFORM option, then 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.
Note:With BY-group processing, SAS writes the results of each BY group to a separate table, so the output might not be uniform across BY groups.
Tip:The UNIFORM option can cause SAS to run out of memory if you are printing a very large table. If this happens, then you can explicitly set the width of each of the columns in the table, and then print the table one page at a time. To do so, you must edit the table definition that you use. For more information, see What You Can Do with a Table Template .

Details

Opening and Closing the PRINTER Destination

You can modify an open PRINTER destination with many ODS PRINTER options. However, the FILE=, HOST, PCL, PDF, PDFMARK, PRINTER=, PS, or SAS options will perform the following actions on an open PRINTER destination:
  • close the open destination referred to in the ODS PRINTER statement
  • close any files associated with the open PRINTER destination
  • open a new instance of the PRINTER destination
If you use one of these options, it is best to explicitly close the destination yourself.
For example, in the following ODS program, the second ODS PRINTER statement closes the PRINTER destination that is opened by the first ODS PRINTER statement. Therefore, the file Bankerstyle.ps will not contain output that is formatted with the Journal style. However, the second ODS PRINTER statement does not affect the PS destination that is opened by the ODS PS statement. The PS destination is still open and the file nostyle.ps could be modified.
The ODS PRINTER statement opens the PRINTER destination and creates PostScript output.
ods printer ps style=banker file='bankerstyle.ps';
proc print data=statepop;
run;
The ODS PS statement opens the PS destination and creates PostScript output.
ods ps file='nostyle.ps';
proc print data=statepop;
run;
The ODS PRINTER statement closes the open PRINTER destination and the files that are associated with it. It then opens a new instance of the PRINTER destination and creates PostScript output.
ods printer ps style=Journal file='Journalstyle.ps';
proc print data=statepop;
run;
ods printer ps close;
ods ps close;

Printing Output Directly to a Printer

Printing output directly to a printer using the ODS PRINTER statement depends on your host operating environment.
Note: To print directly to a printer in the z/OS, UNIX, or VMS operating environment, you can use the FILENAME statement. Specific information about your operating environment is required when using the FILENAME statement. See the SAS documentation for your operating environment before using this statement. Commands are also available in some operating environments that associate a fileref with a file and that break that association.
Methods for Sending SAS Output to a Printer
Platform
Method for Sending SAS Output to a Printer
z/OS
Use the FILENAME statement with the SYSOUT= data set option specified. You can then print to the fileref.
Syntax:
filename your-fileref sysout=a dest=printer-name;
ods printer file=your-fileref;
Example:
filename local sysout=a dest=chpljj21;
ods printer file=local;
UNIX
Use the FILENAME statement with the PIPE command to associate a fileref with your lpr print command.
Syntax:
filename your-fileref pipe 'lpr -P printer-name';
ods printer file=your-fileref;
Example:
filename local pipe 'lpr -P chpljj21';
ods printer file=local;
VMS
Use the FILENAME statement with the PRINTER device type specified to create a printer fileref that you can print to.
Syntax:
filename your-fileref printer passall=yes queue=printer-name;
ods printer file=your-fileref;
Example:
filename local printer passall=yes queue=chpljj21;
ods printer file=local;
Windows
If you want to print to your default printer use this code.
Syntax:
ods printer;
If you want to print to a printer that is not the default, then use the PRINTER= option to specify the printer name.
Syntax:
ods printer printer=printer-name;
Example:
ods printer printer=chpljj21;
To find out what printers are available, select Startthen selectSettingsthen selectPrinters from the Taskbar. If a printer is listed there, then you can use it with the ODS PRINTER statement. If the printer name has spaces, then you must put the printer name in quotation marks.

Using ODS PRINTER with Windows

In the Windows operating environment, the ODS PRINTER statement produces output that is formatted for your default Windows printer unless you specify a different printer by using the PRINTER= option. Refer to PRINTER= option. You can also produce printable output files in PCL, PDF, or PostScript format by using the appropriate option.
In SAS 9.3, you can change the default printer values in the SAS Registry. See Changing SAS Registry Settings for ODS for more detailed information about this “Default Printer” attribute and how it can be modified.

Using ODS PRINTER with All Other Hosts

When you use the ODS PRINTER statement in any other operating environment, ODS uses the SAS drivers to produce output files in PCL, PDF, or PostScript formats. The ODS PRINTER statement produces PostScript output files by default unless you change the default in the SAS Registry. You can also produce printable output files in PCL or PDF format by using the appropriate option or registry setting. See Changing SAS Registry Settings for ODS for more detailed information about this “Default Printer” attribute and how it can be modified.

PDF Security

You can easily encrypt and password-protect your PDF output files. Two levels of security are available: 40-bit (low) and 128-bit (high). With either of these settings, a password will be required to open a PDF file that has been generated with ODS.
To enable encryption and password protection, specify the OPTIONS statement. The following code shows how to encrypt your PDF output file with a low level of encryption. The PDF file generated will be password protected.
options pdfsecurity=low pdfpw=(open=testpw);  
The following code shows how to encrypt your PDF output file with a high level of encryption that is password protected:
options pdfsecurity=high pdfpw=(open=testpw); 
The following code shows the PDF security option used with the PDF destination:
options pdfsecurity=high pdfpw=(open=testpw);
ods pdf file="secure.pdf";
proc contents data=sashelp.class;
 run;
ods pdf close; 
For detailed information about the PDF Security options, see Securing ODS Generated PDF Files.
Note: Encryption requires Acrobat version 5.0 or later.

PDF Views

System options PDFPAGELAYOUT and PDFPAGEVIEW enable you to control the way you view your PDF document. The PDFPAGELAYOUT system option controls the page layout. This setting is equivalent to selecting Viewthen selectPage Display in Adobe Acrobat Reader when a document is open. The PDFPAGEVIEW system option controls the page viewing mode. This setting is equivalent to selecting Viewthen selectZoom in Adobe Acrobat Reader.
For detailed information about these system options, see SAS System Options: Reference.

Example: Selecting Output for the HTML and PRINTER Destinations

Features:

ODS _ALL_ CLOSE

ODS HTML statement:: BODY=

ODS PRINTER statement::
FILE=
PS

ODS LISTING statement:: CLOSE

ODS SELECT statement::
with label
with name
with path
Other features:

PROC UNIVARIATE

Data set: StatePop
This example selects three output objects from a UNIVARIATE procedure step to send to both the HTML destination and to the PRINTER destination.

Program

title;
options nodate nonumber;
ods html body='your_file.html';
ods printer ps file='your_file.ps';
ods select BasicMeasures
           'Tests For Location'
           Univariate.CityPop_90.ExtremeObs;
proc univariate data=statepop mu0=3.5;
   var citypop_90 citypop_80;
run;
ods printer close;

Program Description

title;
Set the SAS system options.The OPTIONS statement controls several aspects of the PRINTER output. The NODATE system option specifies that SAS not print the date and the time. The NONUMBER system option specifies that SAS not print the page number on the first title line of each page of SAS output. These options do not affect the HTML output.
options nodate nonumber;
Create HTML output.The BODY= option sends all output objects to the external file that you specify. Some browsers require an extension of HTM or HTML on the filename.
ods html body='your_file.html';
Create PostScript output.The ODS PRINTER statement opens the PRINTER destination and the PS option specifies PostScript output. FILE= sends all output objects to the external file that you specify.
ods printer ps file='your_file.ps';
Specify the output objects to send to the open destinations. The ODS SELECT statement specifies three output objects to send to all open destinations. The first output object is selected by its name, BasicMeasures. The second output object is selected by its label, Tests For Location. These two selection criteria select the output objects for the analysis of both variables. The third output object is selected by its full path Univariate.CityPop_90.ExtremeObs. This selection criterion selects the output object for only one variable, CityPop_90.
ods select BasicMeasures
           'Tests For Location'
           Univariate.CityPop_90.ExtremeObs;
Compute descriptive statistics for two variables.PROC UNIVARIATE computes descriptive statistics for two variables, CityPop_80 and CityPop_90. ODS routes the selected output objects to the HTML and PRINTER destinations.
proc univariate data=statepop mu0=3.5;
   var citypop_90 citypop_80;
run;
Close the open destinations so that you can view or print the output.The ODS PRINTER CLOSE statement closes the printer destination and all of the files that are associated with them. You must close the printer destination before you can send the output to a physical printer.
ods printer close;

HTML Output

The HTML output includes three output objects for the variable CityPop_90, and two output objects for the variable CityPop_80.
HTML Output for the Variables CityPop_90 and CityPop_80
Variable: CityPop_90 (1990 metropolitan pop in millions)
Variable: CityPop_80 (1980 metropolitan pop in millions)

Printer Output

The printer output includes three output objects for the variable CityPop_90, and two output objects for the variable CityPop_80.
Partial PostScript Output for the Variables CityPop_90 and CityPop_80
PDF output for example