Chapter 8 SAS ESSENTIALS
Chapter 8 SAS ESSENTIALS
Chapter 8 SAS ESSENTIALS
ODS RTF;
ODS PREFERENCES;
(Or end SAS and restart)
ODS Style
When you output information to a SAS ODS format,
the tables, graphs, and text are defined with default
colors and fonts. You can select from several built-in
ODS styles.
Each style is based on some theme or a format
appropriate for a specific purpose. For example, the
JOURNAL style formats your output in black and
white that is appropriate for inclusion in a journal
article. The option to specify a style is
STYLE=styletype;
The default style is Styles. Default. The SAS format styles for
version 9.4 as reported by PROC TEMPLATE are given in
Table 8.1 (with the prefix "Styles." removed to make it easier to
read the table).
JOURNAL
25
RESULTS OF RUNNING THIS CODE:
Open the file ODS3.SAS
Note names of
tables in the SAS
Log file
26
USE THAT INFORMATION:
STEP 2: Use SELECT
tablenames to produce output
that ONLY contains the tables of
interest:
64 71 53 67 55 58
77 57 56 51 76 68 Standard PROC MEANS output:
;
ODS SUMMARY=STATS;
PROC MEANS DATA=WT;
RUN; This information is
also stored in a
SAS data set
named STATS
30
COMBINE THE OUTPUT DATA SET WITH THE
ORIGINAL DATA SET
32
RESULTS FROM COMBINED DATA SET
Data from original Data from the PROC MEANS output table Calculated
data set WT saved as STATS variables
33
RESULTS FROM COMBINED DATA SET
Data from original Data from the PROC MEANS output table Calculated
data set WT saved as STATS variables
34
Using ODS Graphics from SAS Procedures
ODS graphics refers to graphs that are created from SAS
procedures. Although ODS graphics have been around
for several SAS versions, the graphics only recently
began appearing automatically when you run a SAS
PROC (at least in the Windows edition of SAS).
Sometimes, the automatic creation of ODS graphics
takes a while, and if you are doing a lot of analyses and
only want the tabled output, you might be interested in
shutting off ODS graphics for a while. You can do this
(temporarily) using the command
ODS GRAPHICS CLOSE;
To turn ODS graphics back on use
ODS GRAPHICS ON;
PROC TTEST;
CLASS BRAND; VAR HEIGHT;
Title 'Independent Group t-Test
Example';
RUN;
TABLES STATUS/PLOTS=FREQPLOT;
VAR ISS/STYLE={FOREGROUND=FMTSEVERE.};
VAR ISS/STYLE={FOREGROUND=FMTSEVERE.
BACKGROUND=LIGHTYELLOW
This code is used in the
FONT_WEIGHT=BOLD Hands On Example p
207
FONT_FACE=SCRIPT
FLYOVER='Severity Rating'};
These slides are provided for you to use to teach SAS using this book. Feel
free to modify them for your own needs. Please send comments about errors
in the slides (or suggestions for improvements) to acelliott@smu.edu.
Thanks.
48 SAS ESSENTIALS -- Elliott & Woodward