38
1
SA118-2014
SAS ODS HTML + PROC Report = Fantastic Output
Girish K. Narayandas, OptumInsight, Eden Prairie, MN
ABSTRACT
ODS (Output Delivery System) is a wonderful feature in SAS to create consistent, presentable
reports. Using this feature in combination with the powerful PROC Report can give you a lot of
control over the report structure, design and overall appearance. You can set the column width,
font style and size, add colors where desired, and include a picture or a logo, just to name a
few. This paper contains tips and tricks for producing a presentation-worthy HTML output
making use of some of the key features available in ODS HTML, PROC Report and SAS Macros.
INTRODUCTION
Most companies strive to maintain uniformity and a certain level of consistency across the SAS
reports they generate in order to align with corporate branding. Things such as the logo, colors,
fonts, report structure etc., are some of the key details that define a corporate brand. In the
data reporting world, it is common to see multiple developers/programmers creating reports
separately. Sometimes these programmers are spread out across the country. In the case of
global companies, they might even be located in different nations. The challenge is that
management wants to see all of these individually developed reports rolled into one document.
A unified document requires manual effort by developers or analysts to compile the individual
outputs, and additional time and effort spent making each report look visually consistent with
the corporate brand. This paper demonstrates how to automate the process by using pre-
existing SAS tools and features. This paper also shows how to add additional functionality to a
summary document such as point-and-click access into the granularity of each report, and a
button to export data into Excel. Following this methodology, each time a new report is created
it will append itself to the summary book and keep the compiled report current and consistent.
ODS HTML + PROC REPORT = FANTASTIC OUTPUT: AN EXAMPLE
Figure 1 is a screen shot of a data ETL (extraction transformation and loading process) quality
check report. This report contains a content page and individual load quality control (QC)
summaries. These summaries are available immediately after each data source loads. Because
data comes from different sources at varying times throughout the month, we want to run a
quality check each time a new data set is refreshed. Each individual report contains tables for
the data source, the load type, whether table validation is required, and what the thresholds
are for quality inspection. In this fictional example, a rolling three-month average of the data
counts, including thresholds, is used to determine if new data is valid. New data’s calculated
validity is displayed with a value ‘PASS’ or ‘FAIL’ in the final column, QC_Result. For quick and
easy readability, the ‘compute’ option in PROC REPORT is utilized to change the color of the cell
to be green for pass and red for the tables that failed QC inspection.