ODS PDF Statement

Opens, manages, or closes the PDF destination, which produces PDF output, a form of output that is read by Adobe Acrobat and other applications.
Valid in: Anywhere
Category: ODS: Third-Party Formatted
Restriction: PDF does not support double-byte Type1 fonts.
Notes: By default, the ODS PDF statement creates Scalable Vector Graphics. Scalable Vector Graphics (SVG) is an XML language for describing two-dimensional vector graphics.For information about scalable vector graphics, see Using Scalable Vector Graphics in SAS/GRAPH: Reference.

You can add Drill-Down graphs in your PDF file. For detailed information about drill-down graphs and about writing graphs to a PDF file, refer toWriting Your Graphs to a PDF File in SAS/GRAPH: Reference.

Tip: The PDF driver that SAS uses does not recognize all Microsoft Windows fonts. You must enter any such fonts into the SAS registry in order for SAS to find them. See The SAS Registry in SAS Language Reference: Concepts.

Syntax

ODS PDF <(<ID=> identifier)> < action> ;

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
Insert a string of keywords into the output file's metadata
Create a new file at the specified starting-point
Specify that the output from the destination be added to an ODS package
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
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

If you use the ODS PDF statement without an action or options, then it opens the PDF destination and creates PDF output.

Actions

The following actions are available for the ODS PDF 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: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 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.
(<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'

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

The ODS Printer Family of Statements

The ODS PDF statement is part of the ODS printer family of statements. Statements in the printer family open the PCL, PDF, PRINTER, or PS destination, producing output that is suitable for a high-resolution printer. The ODS PCL, ODS PRINTER, and ODS PS statements are also members of the ODS printer family of statements.

Opening and Closing the PDF Destination

You can modify an open PDF destination with many ODS PDF options. However, the FILE= and SAS options will perform the following actions on an open PDF destination:
  • close the open destination referred to in the ODS PDF statement
  • close any files associated with the open PDF destination
  • open a new instance of the PDF destination
If you use one of these options, it is best if you explicitly close the destination yourself.

Example: Opening Multiple Instances of the Same Destination at the Same Time

Features:
ODS PDF statement option::
ID=
STYLE=
FILE=
Other features:

PROC FORMAT

PROC SORT

PROC REPORT

NOBYLINE|BYLINE system option

#BYVAL parameter in titles

Data set: Grain_Production
This example opens multiple instances of the PDF destination to create PDF output. One instance uses the default style definition and the second instance uses the STYLE= option to specify the Journal style definition.

Program

proc sort data=grain_production;
   by year country type;
run;
ods HTML close;
ods pdf file='grain-1.pdf' pdftoc=2;
ods pdf (id=journalstyle) style=journal file='grain-2.pdf' pdftoc=3;

options nobyline nodate;
title 'Leading Grain-Producing Countries';
title2 'for #byval(year)';
proc report data=grain_production nowindows;
   by year;
   column country type kilotons;
   define country  / group width=14 format=$cntry.;
   define type     / group 'Type of Grain';
   define kilotons / format=comma12.;
   footnote 'Measurements are in metric tons.';
run;
options byline;
title2;
proc tabulate data=grain_production format=comma12.;
   class year country type;
   var kilotons;
   table year,
         country*type,
         kilotons*sum=' ' / box=_page_ misstext='No data';
   format country $cntry.;
   footnote 'Measurements are in metric tons.';
run;
ods pdf close;
ods pdf(id=journalstyle) close;
ods html;

Program Description

Sort the data set Grain_Production.SORT sorts the data first by values of Year, then by values of Country, and finally by values of Type.
proc sort data=grain_production;
   by year country type;
run;
Close the HTML destination so that no HTML output is produced. The HTML destination is open by default. The ODS HTML CLOSE statement closes the HTML destination to conserve resources. If the destination were left open, then ODS would produce both HTML and PDF output.
ods HTML close;
Create two different PDF output files at the same time. The ODS PDF statement opens the PDF destination and creates PDF output. The file Grain-1.pdf is created by the first ODS PDF statement. Because no style definition is specified, the default style, Styles.Printer, is used. The PDFTOC=2 option specifies that the table of contents is expanded two levels. The file Grain-2.pdf is created by the second ODS PDF statement with the ID= option specified. The STYLE= option specifies that ODS use the style definition Journal. The ID= option gives this instance of the PDF destination the name JournalStyle. The PDFTOC=3 option specifies that the table of contents is expanded three levels. If you do not specify the ID= option, this ODS PDF statement will close the instance of the PDF destination that was opened by the previous ODS PDF statement and open a new instance of the PDF destination. The file Grain-1.pdf will contain no output.
ods pdf file='grain-1.pdf' pdftoc=2;
ods pdf (id=journalstyle) style=journal file='grain-2.pdf' pdftoc=3;
Suppress the default BY line, suppress the printing of the date, and use the BY value in a title. The NOBYLINE option suppresses the BY line. The #BYVAL specification inserts the current value of the BY variable Year into the title.

options nobyline nodate;
title 'Leading Grain-Producing Countries';
title2 'for #byval(year)';
Produce a report. This PROC REPORT step produces a report on grain production. Each BY group produces a page of output.
proc report data=grain_production nowindows;
   by year;
   column country type kilotons;
   define country  / group width=14 format=$cntry.;
   define type     / group 'Type of Grain';
   define kilotons / format=comma12.;
   footnote 'Measurements are in metric tons.';
run;
Restore the BY line and clear the second title statement. The BYLINE option restores the BY line. The TITLE2 statement clears the second TITLE statement.
options byline;
title2;
Produce a report that contains one table for each year. The TABLE statement in this PROC TABULATE step has Year as the page dimension. Therefore, PROC TABULATE explicitly produces one table for 1995 and one for 1996.
proc tabulate data=grain_production format=comma12.;
   class year country type;
   var kilotons;
   table year,
         country*type,
         kilotons*sum=' ' / box=_page_ misstext='No data';
   format country $cntry.;
   footnote 'Measurements are in metric tons.';
run;
Close the open destinations so that you can view or print the output.The ODS PDF CLOSE statement closes the first instance of the PDF destination and all of the files that are associated with it. The ODS PDF (ID=JOURNALSTYLE) statement closes the second instance of the PDF destination and all of the files that are associated with it. You must close the destinations before you can view the output with a browser or before you can send the output to a physical printer.
ods pdf close;
ods pdf(id=journalstyle) close;
Open the HTML destination. The ODS HTML statement opens the HTML destination and resturns ODS to its default setting.
ods html;

PDF Output

PDF Output with the Default Style Definition
PDF Output With the Default Style Definition
PDF Output Using Journal Style Definition
PDF Output Using Journal Style Definition