Introduction

PROC TABULATE reports can summarize your data in many ways. But you may want to add formatting options that are not available in SAS' standard listing output. For example, you might want to draw attention to important facts. What matters most in the following table are the revenue figures (Revenue) and the number of passengers (Deplaned) to the destinations.


 
                 LaGuardia Flights by Destination
                      and Revenue, March 4-10

 +------------------------------------------------------------------+
 |                         |   Min   |   Max   |   Mean  |    Sum   |
 |------------+------------+---------+---------+---------+----------|
 |Destination |            |         |         |         |          |
 |------------+------------|         |         |         |          |
 |Copenhagen  |Boarded     |       81|      154|      131|       786|
 |            |------------+---------+---------+---------+----------|
 |            |Transferred |        5|       21|       13|        75|
 |            |------------+---------+---------+---------+----------|
 |            |Deplaned    |      103|      177|      147|       881|
 |            |------------+---------+---------+---------+----------|
 |            |Revenue     | $109,885| $196,540| $139,951|  $839,705|
 |------------+------------+---------+---------+---------+----------|
 |Frankfurt   |Boarded     |      129|      210|      170|     1,190|
 |            |------------+---------+---------+---------+----------|
 |            |Transferred |        5|       22|       13|        91|
 |            |------------+---------+---------+---------+----------|
 |            |Deplaned    |      147|      237|      188|     1,314|
 |            |------------+---------+---------+---------+----------|
 |            |Revenue     | $100,987| $187,636| $142,912|$1,000,382|
 |------------+------------+---------+---------+---------+----------|
 |London      |Boarded     |      151|      241|      188|     3,760|
 |            |------------+---------+---------+---------+----------|
 |            |Transferred |        4|       18|       11|       227|
 |            |------------+---------+---------+---------+----------|
 |            |Deplaned    |      114|      250|      199|     3,987|
 |            |------------+---------+---------+---------+----------|
 |            |Revenue     | $106,753| $198,744| $159,478|$3,189,554|
 |------------+------------+---------+---------+---------+----------|
 |Paris       |Boarded     |      146|      182|      161|     2,089|
 |            |------------+---------+---------+---------+----------|
 |            |Transferred |        7|       29|       16|       204|
 |            |------------+---------+---------+---------+----------|
 |            |Deplaned    |      153|      227|      183|     2,378|
 |            |------------+---------+---------+---------+----------|
 |            |Revenue     | $123,456| $195,468| $151,477|$1,969,201|
 +------------------------------------------------------------------+


By using the Output Delivery System (ODS), you can highlight the Revenue rows and certain values of Deplaned. You can control fonts and colors, embed GIF images, and even change cell appearance according to cell values.

Note: To see the full range of colors in the tables in this lesson, your computer must have a 16-bit or better display. If you have an 8-bit (256 color) display, some colors will not appear as described.


LaGuardia Flights by Destination
and Revenue, March 4-10

  Min Max Mean Sum
Destination   81 154 131 786
Copenhagen

Flag of Denmark

Boarded
Transferred 5 21 13 75
Deplaned 103 177 147 881
Revenue 109,885 196,540 139,951 839,705
Frankfurt

Flag of Germany

Boarded 129 210 170 1,190
Transferred 5 22 13 91
Deplaned 147 237 188 1,314
Revenue 100,987 187,636 142,912 1,000,382
London

Flag of UK

Boarded 151 241 188 3,760
Transferred 4 18 11 227
Deplaned 114 250 199 3,987
Revenue 106,753 198,744 159,478 3,189,554
Paris

Flag of France

Boarded 146 182 161 2,089
Transferred 7 29 16 204
Deplaned 153 227 183 2,378
Revenue 123,456 195,468 151,477 1,969,201


This table is the same as the first one. This version, however, uses color to draw your attention to specific items within the data. In addition, the pink and purple cells contain short notes, which Internet Explorer users can read by briefly holding the mouse pointer above the cells. This lesson leads you step by step through the process of creating the table that you see above.

Caution: By default, all code you submit to SAS with Enterprise Guide has ODS statements included to create HTML output. You must set options in SAS Enterprise Guide before you can do the practices in this lesson.


Caution: By default, all code you submit to SAS with Enterprise Guide has ODS statements included to create HTML output. You must set options in SAS Enterprise Guide before you can do the practices in this lesson.


This lesson contains pages and takes approximately 1.5 hours to complete.


In this lesson, you learn to

  • apply the STYLE= option to table elements
  • apply colors to table cells
  • apply style attributes to multiple cells
  • change the appearance of text
  • apply conditional styles to cells (trafficlighting)
  • add fly-over text to values
  • include HTML tags directly in SAS statements
  • embed images in table cells.

Before taking this lesson, you should be familiar with the concept and syntax of HTML tags. You should also complete the following lessons:
  • .