Understanding and Customizing SAS Output: The Output Delivery System (ODS) |
You select the format for your output by opening and
closing ODS destinations in your program. When one or more destinations are
open, ODS can send output objects to them and produce formatted output. When
a destination is closed, ODS does not send an output object to it and no output
is produced.
By default, all programs automatically produce Listing
output along with output for other destinations that you specifically open.
Therefore, by default, the Listing destination is open, and all other destinations
are closed.
To
create formatted output, open one or more destinations by using the following
ODS statements:
ODS HTML file-specification(s);
|
ODS OUTPUT data-set-definition;
|
ODS PRINTER file-specification;
|
ODS RTF file-specification;
|
The argument file-specification
opens the destination and specifies one or more files to write to. The argument data-set-definition opens the Output destination and enables
SAS to create a data set from an output object.
To view or print the ODS output that you have selected, you need
to close all the destinations that you opened, except for the Listing destination.
You can use separate statements to close individual destinations, or use one
statement to close all destinations (including the Listing destination). To
close ODS destinations, use the following statements:
Note:
The ODS
_ALL_ CLOSE statement,
which closes all open destinations, is available with SAS Release 8.2 and
higher. ![[cautionend]](../../../../common/64368/HTML/default/images/cautend.gif)
In some cases you might not want to create Listing output.
Use the ODS
LISTING CLOSE;
statement at the beginning of your
program to close the Listing destination and prevent SAS from producing Listing
output. Closing unnecessary destinations conserves system resources.
Note: Because ODS statements are global statements,
it is good practice to open the Listing destination at the end of your program.
If you execute other programs in your current SAS session, Listing output
is then available. To open the Listing destination, use the
ODS LISTING;
statement at the end of your program. ![[cautionend]](../../../../common/64368/HTML/default/images/cautend.gif)
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.