O'Reilly logo

Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

options nodate nonumber;
proc sort data=sashelp.prdsale out=prdsale;
by Country;
run;
title;
proc tabulate data=prdsale;
class region division prodtype;
classlev region division prodtype;
var actual;
keyword all sum;
keylabel all='Total';
table (region all)*(division all),
(prodtype all)*(actual*f=dollar10.) /
misstext=[label='Missing']
box=[label='Region by Division and Type'];
run;
title 'Actual Product Sales';
title2 '(millions of dollars)';
proc univariate data=prdsale;
by Country;
var actual;
run;
title 'Sales Figures for First Quarter by Product';
proc sgpanel data=prdsale;
where quarter=1;
panelby product / novarname;
vbar region / response=predict;
vline region / response=actual lineattrs=GraphFit;
colaxis fitpolicy=thin;
rowaxis label='Sales';
run;
Note: The examples use filenames that might not be valid in all operating environments.
For information about how your operating environment uses file specifications, see
the documentation for your operating environment.
Understanding ODS Output Formats and
Destinations
The Output Delivery System (ODS) enables you to produce output in a variety of
formats that you can easily access. ODS creates various types of tabular output by
combining raw data with one or more table templates to produce one or more output
objects. The basic component of ODS functionality is the output object. The PROC or
DATA step that you run provides the data component (raw data) and the name of the
table template that contains the formatting instructions. The data component and table
template together form the output object. These objects can be sent to any or all ODS
destinations, such as PDF, HTML, RTF, or LISTING. By default, in the SAS windowing
Understanding ODS Output Formats and Destinations 645
environment for Windows and UNIX, SAS uses ODS to produce HTML output. By
default, in batch mode, SAS produces LISTING output. By specifying an ODS
destination, you control the type of output that SAS creates.
The following figure illustrates the concept of output. The data and the table template
form an output object, which creates the type of ODS output that you specified in the
ODS template.
Figure 34.1 Model of the Production of ODS Output
DOCUMENT
DOCUMENT
Output
Destinations Formatted by SAS
Data
Component
Output
Object
+
Table
Template
Destinations Formatted by a Third Party
LISTING
LISTING
Output
OUTPUT
SAS
Data Set
HTML
HTML
Output
MARKUP
SAS
Tagsets*
User-Defined
Tagsets
PRINTER
MS
Windows
Printers
PS PCL PDF
RTF EPUB POWERPOINT
EPUB
Output
POWERPOINT
Output
ODS
Destinations
ODS
Outputs
RTF
Output
The following definitions describe the terms in the preceding figure:
data component
Each procedure that supports ODS and each DATA step produces data, which
contains the results (numbers and characters) of the step in a form similar to a SAS
data set.
table template
The table template is a set of instructions that describes how to format the data. This
description includes but is not limited to the following items:
the order of the columns
text and order of column headings
formats for data
font sizes and font faces
output object
ODS combines formatting instructions with the data to produce an output object. The
output object, therefore, contains both the results of the procedure or DATA step and
information about how to format the results. An output object has a name, a label,
and a path.
Note: Although many output objects include formatting instructions, not all of them
do. In some cases the output object consists of only the data.
ODS destinations
An ODS destination specifies a specific type of output. ODS supports a number of
destinations, including but not limited to the following:
EPUB
produces output with the .epub extension. E-books that use the .epub format can
be read by a wide variety of e-book readers.
646 Chapter 34 Understanding and Customizing SAS Output: The Output Delivery System (ODS)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required