I have good news and bad news for you about changing the appearance of your output. The good news is that if you had enough time to learn all of the ways in which you could change the appearance of your SAS output, you could create just about anything you wanted. The bad news is that we don't have enough time in this course to explore all of the possibilities. In fact, we'll barely nibble the surface. In this section, we will only investigate how to use the ODS HTML statement's STYLE= option to change the appearance of the default HTML output by using one of the many predefined style templates built into SAS.
Example 24.9 Section
The following program uses the ODS HTML statement's STYLE= option to tell SAS to use the meadow style when displaying the HTML output created by printing a subset of the stat481.penngolf data set:
ODS HTML file = 'C:\yourdrivename\Stat481WC\12ods\output\golf9.html'
style = meadow;
PROC PRINT data = stat481.penngolf NOOBS;
title 'Some of the penngolf data set variables';
ID name;
var year type par yards;
RUN;
ODS HTML CLOSE;
Name | Year | Type | Par | Yards |
---|---|---|---|---|
Toftrees | 1968 | Resort | 72 | 7018 |
Penn State Blue | 1921 | Public | 72 | 6525 |
Centre Hills | 1921 | Private | 71 | 6392 |
Lewistown CC | . | Private | 72 | 6779 |
State College Elks | 1973 | SemiPri | 71 | 6369 |
Park Hills CC | 1966 | SemiPri | 70 | 6004 |
Sinking Valley CC | 1967 | SemiPri | 72 | 6755 |
Williamsport CC | 1909 | Private | 71 | 6489 |
Standing Stone GC | 1973 | SemiPri | 70 | 6593 |
Bucknell GC | 1960 | SemiPri | 70 | 6253 |
Mount Airy Lodge | 1972 | Resort | 72 | 7123 |
As you can see, telling SAS what style to use is as simple as adding the STYLE= option to the ODS HTML statement. Launch and run the SAS program, and review the output to see the appearance of the HTML output when created using the meadow style template.
Example 24.10 Section
Of course you are asking yourself "how would I know that meadow is one of the available predefined styles?" Fortunately, the answer is simple enough. The following TEMPLATE procedure produces a list of the predefined style templates that are available on your system:
PROC TEMPLATE;
LIST STYLES;
RUN;
Listing of: SASHELP.TMPLMST | ||
---|---|---|
Path Filter is: Styles | ||
Sort by: PATH/ASCENDING | ||
Obs | Path | Type |
1 | Styles | Dir |
2 | Styles.Analysis | Style |
3 | Styles.BarrettsBlue | Style |
4 | Styles.DTree | Style |
5 | Styles.Daisy | Style |
6 | Styles.Default | Style |
7 | Styles.Dove | Style |
8 | Styles.EGDefault | Style |
9 | Styles.Excel | Style |
10 | Styles.FancyPrinter | Style |
11 | Styles.Festival | Style |
12 | Styles.FestivalPrinter | Style |
13 | Styles.Gantt | Style |
14 | Styles.GrayscalePrinter | Style |
15 | Styles.HTMLBlue | Style |
16 | Styles.HTMLEncore | Style |
17 | Styles.Harvest | Style |
18 | Styles.HighContrast | Style |
19 | Styles.HighContrastLarge | Style |
20 | Styles.Journal | Style |
21 | Styles.Journal1a | Style |
22 | Styles.Journal2 | Style |
23 | Styles.Journal2a | Style |
24 | Styles.Journal3 | Style |
25 | Styles.Journal3a | Style |
26 | Styles.Listing | Style |
27 | Styles.Meadow | Style |
28 | Styles.MeadowPrinter | Style |
29 | Styles.Minimal | Style |
30 | Styles.MonochromePrinter | Style |
31 | Styles.Monospace | Style |
32 | Styles.Moonflower | Style |
33 | Styles.Netdraw | Style |
34 | Styles.NoFontDefault | Style |
35 | Styles.Normal | Style |
36 | Styles.NormalPrinter | Style |
37 | Styles.Ocean | Style |
38 | Styles.Pearl | Style |
39 | Styles.PearlJ | Style |
40 | Styles.Plateau | Style |
41 | Styles.PowerPointDark | Style |
42 | Styles.PowerPointLight | Style |
43 | Styles.Printer | Style |
44 | Styles.Raven | Style |
45 | Styles.Rtf | Style |
46 | Styles.Sapphire | Style |
47 | Styles.SasDocPrinter | Style |
48 | Styles.SasWeb | Style |
49 | Styles.Seaside | Style |
50 | Styles.SeasidePrinter | Style |
51 | Styles.Snow | Style |
52 | Styles.StatDoc | Style |
53 | Styles.Statistical | Style |
54 | Styles.vaDark | Style |
55 | Styles.vaHighContrast | Style |
56 | Styles.vaLight | Style |
Launch and run the SAS code, and review the output to see the list of predefined styles that are shipped with SAS. You might want to try some of the styles out yourself. While I do find some of the styles rather nice, I personally find some of them rather hideous (and therefore useless to me).