Previous Page | Next Page

Dictionary of ODS Language Statements

ODS PRINTER Statement



Opens, manages, or closes the PRINTER destination, which produces printable output.
Valid: 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, 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:
When you are producing 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.   [cautionend]

Syntax
Without an Action or Options
Actions
Options
Details
Opening and Closing the PRINTER Destination
Printing Output Directly to a Printer
Using ODS PRINTER with Windows
Using ODS PRINTER with All Other Hosts
PDF Security
PDF Views
Example
Selecting Output for the HTML and PRINTER Destinations

Syntax

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


Without an Action or Options

If you use the ODS PRINTER statement in the UNIX, VMS, or z/OS operating environments without an action or options, then it opens the PRINTER destination and creates PostScript output, 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

An action can be one of the following:

CLOSE

closes the destination and the file that is associated with it. 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 frees some system resources.
EXCLUDE exclusion(s)| ALL | NONE

excludes output objects from the destination.

Default: NONE
Restriction: The destination must be open for this action to take effect.
Main discussion: ODS EXCLUDE Statement
SELECT selection(s) | ALL | NONE

selects output objects for the destination.

Default: ALL
Restriction: The destination must be open for this action to take effect.
Main discussion: ODS SELECT Statement
SHOW

writes the current selection 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.
See also: ODS SHOW Statement

Options

ODS PRINTER Option Summary Table
Task Option
Specify the root name for the anchor tag that identifies each output object in the current file ANCHOR=
Insert the text string that you specify as the author in the metadata of a file AUTHOR=
Specify a string to use as the first part of all references that ODS creates in the file BASE=
Specify whether to generate and display the list of bookmarks for a PDF file BOOKMARKLIST=
Control the generation of bookmarks in a PDF file BOOKMARKGEN=
Apply a specified color scheme to your output COLOR=
Specify the number of columns to create on each page of output COLUMNS=
Specify the compression of a PDF file. Compression reduces the size of the file COMPRESS=
Control the generation of a printable table of contents CONTENTS=
Specify a cascading style sheet to apply to your output CSSSTYLE=
Specify the image resolution in dots per inch for output images DPI=
Specify the file to write to FILE=
Use the printer drivers that the host system provides HOST
Open multiple instances of the same destination at the same time ID=
Insert a string of keywords into the output file's metadata KEYWORDS=
Create a new file at the specified starting-point NEWFILE=
Omit the table of contents (Bookmark list) that is produced by default when producing PDF or PDFMARK output NOTOC
Specify that the output from the destination be added to an ODS package PACKAGE
Create PCL output PCL
Create PDF output PDF
Insert special markup which is used when converting a PostScript file to a PDF file PDFMARK
Control whether notes are added to a PDF file for items that are associated with the FLYOVER= style attribute PDFNOTE
Control the level of the expansion of the table of contents in PDF documents PDFTOC=
Create output that is formatted for the specified printer PRINTER=
Create PostScript output PS
Control page breaks STARTPAGE=
Specify the style definition to use in writing the PDF output STYLE=
Insert the text string that you specify as the subject in the metadata of a file SUBJECT=
Insert text into your output TEXT=
Insert the text string that you specify as the title in the metadata of a file TITLE=
For multi-page tables, provide uniformity from page to page within a single table UNIFORM

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.
Tip: You can change anchor names as often as you want by submitting the ANCHOR= option in a valid statement anywhere in your program. Once you have specified an anchor name, it remains in effect until you specify a new one.
Tip: 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 into the metadata of a file, the text string that you specify as the author.

author-text

is the text in the metadata of an open file that indicates the author.

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.
Restriction: 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 a PDF file.

Note:   The generation of the bookmarks is not affected by the setting of this option. Bookmarks are generated by the BOOKMARKGEN= option.  [cautionend]

HIDE

generates a list of bookmarks for your PDF file. The bookmarks are not automatically displayed when you open the PDF file.

NONE

specifies not to generate a list of bookmarks for your PDF file.

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

generates a list of bookmarks for your PDF file. The bookmarks are automatically displayed when you open the PDF file.

Alias: YES | ON
Alias: BOOKMARKLIST is an alias for BOOKMARKLIST=SHOW | YES | ON.
Default: SHOW
Restriction: This option can be set only when you first open the destination.
Restriction: This option has an affect only when creating PDF or PDFMARK output.
Interaction: The NOTOC option specifies BOOKMARKLIST= OFF and CONTENTS= OFF.
BOOKMARKGEN | NOBOOKMARKGEN | BOOKMARKGEN=

controls the generation of bookmarks in a PDF file.

BOOKMARKGEN

specifies to generate bookmarks in the PDF file.

BOOKMARKGEN=

controls the generation of bookmarks in a PDF file.

NO

specifies not to generate bookmarks in the PDF file.

Alias: OFF
YES

specifies to generate bookmarks in the PDF file.

Alias: ON
NOBOOKMARKGEN

specifies not to generate bookmarks in the PDF file.

Default: YES or BOOKMARKGEN
Restriction: This option can be set only when you first open the destination.
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.

Tip: 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.

Default: YES
Tip: If you choose color output for a printer that does not support color, then your output might be difficult to read.
Tip: In order to actually print in color, you must also
  • 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 Language Reference: Dictionary.

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
Restriction: Use this option only with the ODS PDF statement and the ODS PRINTER statement with the PDF option specified.
Restriction: The COMPRESS= option takes effect only if specified at the opening of a file.
Interaction: 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, refer to the DEFLATION option in SAS Language Reference: Dictionary.
Interaction: 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, refer to the UPRINTCOMPRESSION system option in SAS Language Reference: Dictionary.
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-1 <..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 Language Reference: Dictionary.
"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.
Requirement: You must enclose media-type in parentheses.
Requirement: 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 specify the STYLESHEET= option, or you can view the source of an HTML file and look at the code between the <STYLE> </STYLE> tags at the top of the file. For an example of a valid for ODS CSS file, see Applying a CSS File to ODS Output.
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.
Featured in: Applying a CSS File to ODS Output
DPI=

specifies the image resolution for output files.

Default= 150
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 Language Reference: Dictionary.
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 Language Reference: Dictionary.
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 into the output file's metadata, a string of keywords . The keywords enable a document management system to do topic-based searches.

keywords-text

is the string of keywords.

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.
Restriction: 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 that you start a new procedure.

Default: NONE
Restriction: The NEWFILE= option cannot be used in conjunction with the FILE=fileref option.
Restriction: The NEWFILE= option cannot be used if you are sending output to a physical printer.
Tip: 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.

See also:

ODS PACKAGE Statement

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.

Restriction: Do not use this option in conjunction with the PCL or PS options.
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.
Featured in: Opening Multiple Instances of the Same Destination at the Same Time
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 CORE [arrow] PRINTING [arrow] Default Printer
Restriction: printer-name must match a subkey in either the SAS registry or the Windows printer registry.
Restriction: 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.
Tip: 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 CORE [arrow] PRINTING [arrow] PRINTERS [arrow] selected-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, then a description of the printer is located in the Windows registry.

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

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.
PS

creates PostScript output.

Alias: POSTSCRIPT
Restriction: Do not use this option in conjunction with the PDF or PCL options.
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

controls page breaks.

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.   [cautionend]
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.   [cautionend]
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: ODS [arrow] DESTINATIONS [arrow] PRINTER. By default, this value is Printer for the PRINTER, PDF, and PS destinations and MonochromePrinter for the PCL destination.
Main discussion: For a complete discussion of style definitions, see Working with Styles.
See also: For instructions on making your own user-defined style definitions, see TEMPLATE Procedure: Creating a Style Template (Definition).
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.

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.
Restriction: 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.
Featured in: Conditionally Excluding Output Objects and Sending Them to Different Output Destinations
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.

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.
Restriction: 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.

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

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.
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, any of the following options will automatically close the open destination that is referred to in the ODS PRINTER statement, and will also close any files that are associated with it, and then open a new instance of the destination: FILE=, HOST, PCL, PDF, PDFMARK, PRINTER=, PS, or SAS. If you use one of these options, it is best if you 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 brickstyle.ps will not contain output that is formatted with the d3d 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.

 Note about code
ods printer ps style=brick file='brickstyle.ps';
proc print data=statepop;
run;
 Note about code
ods ps file='nostyle.ps';
proc print data=statepop;
run;

 Note about code
ods printer ps style=d3d file='d3dstyle.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.  [cautionend]

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;

Note:   To find out what printers are available, select Start [arrow] Settings [arrow] Printers 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.   [cautionend]


Using ODS PRINTER with Windows

When you use the ODS PRINTER statement in the Windows operating environment, ODS will produce output that is formatted for your default Windows printer unless you specify a different printer by using the PRINTER= option. You can also produce printable output files in PCL, PDF, or PostScript format by using the appropriate option.


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. By default, the ODS PRINTER statement produces PostScript output files. You can also produce printable output files in PCL or PDF format by using the appropriate option or registry setting.


PDF Security

In SAS 9.2, 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 on the PDF Security options, see Securing ODS Generated PDF Files.

Note:   Encryption requires Acrobat version 5.0 or later.  [cautionend]


PDF Views

Is SAS 9.2, Two new system options 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 View [arrow] Page 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 View [arrow] Zoom in Adobe Acrobat Reader.

Refer to SAS Language Reference: Dictionary for detailed information on these system options.


Example


Example 1: Selecting Output for the HTML and PRINTER Destinations

ODS 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 SAS 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.

Note:   This example uses filenames that might not be valid in all operating environments. To successfully run the example in your operating environment, you might need to change the file specifications. See ODS HTML Statements for Running Examples in Different Operating Environments.  [cautionend]


Program

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

HTML Output

HTML Output for the Variables CityPop_90 and CityPop_80

 Note about figure

[HTML Output for the Variables CityPop_90 and CityPop_80]


Printer Output

Partial PostScript Output for the Variables CityPop_90 and CityPop_80

 Note about figure

[Partial PostScript Output for the Variables CityPop_90 and CityPop_80]

Previous Page | Next Page | Top of Page