message. A log event consists of a log message, a message threshold, and a logger.
Log events are initiated by SAS servers and SAS programs.
When SAS processes a logging facility log event, it compares the message level of
the log event to the message threshold of the logger that is named in the log event. If
the log event message threshold is the same or higher than the logger's message
threshold, the message is written to the locations that are specified by the appenders
that are referenced in the logger definition. If the log event is not accepted by the
logger, the message is discarded.
Appenders are defined for the duration of a macro program or a DATA step. Loggers
are defined for the duration of the SAS session.
For more information, see SAS Logging: Configuration and Programming Reference.
Routing and Customizing SAS Output
Default Output Destination
Definition
The destination in SAS is a designation that the Output Delivery System (ODS) uses to
generate a specific type of output. Or, simply put, it is how and where ODS routes your
output. For example, ODS can route your output to a browser as HTML, to a file, or to
your terminal or display as a simple list report. The destination of your output depends
on the following:
your operating environment
your mode of running SAS
your version of SAS
Default Destinations
In SAS 9.3 and later versions, when running SAS in windowing mode in the Microsoft
Windows and UNIX operating environments, output is sent by default to the HTML
destination (HTML is the default destination). Also, ODS Graphics is turned on by
default in the windowing environment under UNIX and Windows for SAS 9.3 and later
versions.
For running SAS in batch mode, however, LISTING is the default destination for SAS
9.4 and earlier versions, and ODS Graphics is turned off by default. See Table 9.1 on
page 158 for a comparison of output destinations based on SAS version and operating
mode. Your defaults might be different due to your registry or configuration file settings.
The following table shows the default destinations for each method of operation based
on SAS version:
Routing and Customizing SAS Output 157
Table 9.1 Comparison of Default Destinations for Output
SAS Version
Mode of Running
SAS Viewer ODS Destination
SAS 9.3 and later windowing mode SAS Results Viewer or
browser window
HTML
interactive line
mode
terminal display LISTING
noninteractive mode depends on operating environment
batch mode depends on operating environment:
SAS 9.2 windowing mode SAS Output Window LISTING
interactive line
mode
terminal display LISTING
noninteractive mode depends on operating environment
batch mode depends on operating environment
Operating Environment Information
The default destination for SAS output is specific to your operating environment.
Your configuration file and registry settings also affect the where your output is sent.
For specific information about the default output destination, see the SAS
documentation for your operating environment:
UNIX: “The Default Routings for the SAS Log and Procedure Output in UNIX
Environments” in SAS Companion for UNIX Environments
z/OS: “Destinations of SAS Output Files” in SAS Companion for z/OS
Windows: “Managing SAS Output under Windows” in SAS Companion for Windows
For more information about the new defaults and ODS destinations, see the SAS Output
Delivery System: Users Guide.
Changing the Output Destination
Overview
With SAS, there are many ways to control where your log, procedure, and DATA step
output is sent. The method that you use depends on your operating system and the mode
in which you are running SAS. See Table 9.2 on page 159 for a list of commonly used
methods for changing the output destination. You can route your output directly to a PC
or terminal display, to a printer, or to an external file.Output destinations can be specified
using SAS procedures, system options, commands, statements, or global ODS
statements.
158 Chapter 9 SAS Output
Using ODS to Change the Output Destination
Before ODS was introduced in SAS 7, most procedures generated output that was
designed for a traditional line-printer and the output went straight to the listing window
as a simple list report. If you wanted to change the destination of your output, you used
methods such as PROC PRINTTO and the FILENAME statement. Even though these
methods are useful, there are many more options available with ODS for controlling
output. ODS destination statements enable you to specify a variety of formats and
destinations.
The following list describes some of the commonly used ODS statements and other SAS
language elements that are used for routing output.
Table 9.2 Changing the Output Destination
Method to Use Output Result
PRINTTO procedure routes DATA step, log, or procedure output from
the system default destinations to the destination
that you choose. The PRINTTO procedure defines
non-ODS destinations.
FILENAME statement associates a fileref with an external file or output
device and enables you to specify file and device
attributes
FILE command: Windows stores the contents of the LOG or OUTPUT
windows in files that you specify, when the
command is issued from within the windowing
environment.
ODS LISTING Statement opens, manages, or closes the LISTING destination.
ODS OUTPUT Statement produces a SAS data set from an output object and
manages the selection and exclusion lists for the
OUTPUT destination.
ODS DOCUMENT statement produces and ODS document that enables you to
restructure, navigate, and replay your data in
different ways. It also enables you to specify
multiple destinations without needing to rerun your
analysis or repeat your database query.
ODS HTML Statement opens, manages, or closes the HTML destination,
which produces HTML 4.0 output that contains
embedded style sheets.
ODS MARKUP Statement opens, manages, or closes the MARKUP
destination, which produces SAS output that is
formatted using one of many different markup
languages.
ODS PRINTER 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.
Routing and Customizing SAS Output 159
Method to Use Output Result
ODS RTF Statement opens, manages, or closes the RTF destination,
which produces output written in Rich Text Format
for use with Microsoft Word 2002.
SAS System Options redefine the destination of log and output for an
entire SAS program. These system options are
specified when you invoke SAS. The system
options used to route output are the ALTLOG=,
ALTPRINT=, LOG=, and PRINT= options.
For conceptual information about global ODS statements, see the following resources:
“Destination Category Table” in SAS Output Delivery System: Users Guide.
“Types of ODS Statements” in SAS Output Delivery System: Users Guide.
Operating Environment Information
For information about changing the default output location for the z/OS and UNIX
operating environments, see the following resources:
z/OS: “Directing SAS Log and SAS Procedure Output” in SAS Companion for z/OS.
and “Changing the Default Destination” in SAS Companion for z/OS
UNIX: “Changing the Default Routings in UNIX Environments” in SAS Companion
for UNIX Environments
Customizing Output
Making Output Descriptive
There are many statements and system options available in SAS that enable you to
customize your output. You can add informative titles, footnotes, and labels to customize
your output and control how the information is laid out on the page.
The following list describes some of the statements and SAS system options that you can
use:
Table 9.3 Methods for Making Output Descriptive
SAS Language Element Function
CENTER | NOCENTER system option controls whether output is centered. By default,
SAS centers titles and procedure output on the page
and on the personal computer display.
DATE | NODATE system option controls printing of date and time values. When this
option is enabled, SAS prints on the top of each
page of output the date and time the SAS job
started. When you run SAS in interactive mode, the
date and time the job started is the date and time
that you started your SAS session.
160 Chapter 9 SAS Output
SAS Language Element Function
FOOTNOTE statement prints footnotes at the bottom of each output page.
You can also use the FOOTNOTES window for this
purpose.
FORMCHAR= specifies the default output formatting characters
for some procedures such as CALENDAR, FREQ,
REPORT, and TABULATE.
FORMDLIM= specifies the default output formatting characters
for some procedures such as CALENDAR, FREQ,
REPORT, and TABULATE.
LABEL statement associates descriptive labels with variables. With
most procedure output, SAS writes the label rather
than the variable name.
The LABEL statement also provides descriptive
labels when it is used with certain SAS procedures.
See Base SAS Procedures Guide for information
about using the LABEL statement with a specific
procedure.
LINESIZE= and PAGESIZE= system
options
change the default number of lines per page (page
size) and characters per line (line size) for printed
output. The default depends on the method of
running SAS and the settings of certain SAS system
options. Specify new page and line sizes in the
OPTIONS statement or OPTIONS window. You
can also specify line and page size for DATA step
output in the FILE statement.
The values that you use for the LINESIZE= and
PAGESIZE= system options can significantly affect
the appearance of the output that is produced by
some SAS procedures.
NUMBER | NONUMBER and
PAGENO= system options
control page numbering. The NUMBER system
option controls whether the page number is printed
on the first title line of each page of printed output.
You can also specify a beginning page number for
the next page of output produced by SAS by using
the PAGENO= system option.
global ODS statements enable you to apply styles to your output or to use a
style or table definition.
TITLE statement prints titles at the top of each output page. By
default, SAS prints the following title: The SAS
System
You can use the TITLE statement or TITLES
window to replace the default title or specify other
descriptive titles for SAS programs. You can use
the null title statement (title;) to suppress a
TITLE statement.
Routing and Customizing SAS Output 161
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.90.182