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

Output Produced by the SAS System
Traditional Output
A SAS program can produce some or all of the following types of output:
a SAS data set
contains data values that are stored as a table of observations and variables. It also
stores descriptive information about the data set, such as the names and arrangement
of variables, the number of observations, and the creation date of the data set. A SAS
data set can be temporary or permanent. The examples in this section create the
temporary data set WEIGHT_CLUB.
the SAS log
is a record of the SAS statements that you entered and of messages from SAS about
the execution of your program. It can appear as a file on disk, a display on your
monitor, or a hard-copy listing. The exact appearance of the SAS log varies
according to your operating environment and your site. The output in Log 1.1 on
page 9 displays a typical SAS log for the program in this section.
a report or simple listing
ranges from a simple listing of data values to a subset of a large data set or a complex
summary report that groups and summarizes data and displays statistics. The
appearance of procedure output varies according to your site and the options that you
specify in the program, but the output in Figure 1.2 on page 7 and Figure 1.3 on page
7 illustrate typical procedure output. You can also use a DATA step to produce a
completely customized report. For more information, see “Creating Customized
Reports” on page 458.
other SAS files such as catalogs
contain information that cannot be represented as tables of data values. Examples of
items that can be stored in SAS catalogs include function key settings, letters that are
produced by SAS/FSP software, and displays that are produced by SAS/GRAPH
software.
external files or entries in other databases
can be created and updated by SAS programs. SAS/ACCESS software enables you
to create and update files that are stored in databases such as Oracle.
8 Chapter 1 What is the SAS System?
Log 1.1 Traditional Output: A SAS Log
NOTE: Additional host information:
W32_7PRO DNTHOST 6.1.7601 Service Pack 1 Workstation
NOTE: SAS initialization used:
real time 1.15 seconds
cpu time 0.87 seconds
1 data weight_club;
2 input IdNumber 1-4 Name $ 6-24 Team $ StartWeight EndWeight;
3 Loss=StartWeight-EndWeight;
4 datalines;
NOTE: The data set WORK.WEIGHT_CLUB has 5 observations and 6 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
10 ;
11 proc tabulate data=weight_club;
NOTE: Writing HTML Body file: sashtml.htm
12 class team;
13 var StartWeight EndWeight Loss;
14 table team, mean*(StartWeight EndWeight Loss);
15 title 'Mean Starting Weight, Ending Weight,';
16 title2 'and Weight Loss';
17 run;
NOTE: There were 5 observations read from the data set WORK.WEIGHT_CLUB.
NOTE: PROCEDURE TABULATE used (Total process time):
real time 0.93 seconds
cpu time 0.64 seconds
Output from the Output Delivery System (ODS)
The Output Delivery System (ODS) enables you to produce output in a variety of
formats, such as the following:
an HTML file
a traditional SAS Listing (monospace)
a PostScript file
an RTF file (for use with Microsoft Word)
an output data set
Output Produced by the SAS System 9
The following figure illustrates the concept of output for SAS Version 8.
Figure 1.4 Model of the Production of ODS Output
Data
Table Definition
(formatting instructions)
Output
Object
RTF
Output
SAS
Data
Sets
Listing
Output
HTML
Output
High-resolution
Printer
Output
ODS
Output
}
+
RTF
Destination
Output
Destination
Listing
Destination
HTML
Destination
Printer
Destination
ODS
Destination
}
The following definitions describe the terms in the preceding figure:
data
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 definition
The table definition is a set of instructions that describes how to format the data. This
description includes but is not limited to:
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 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, which include the following:
10 Chapter 1 What is the SAS System?

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