3
data _null_;
declare odsout obj();
obj.format_text(data:"Some text");
run;
REPORTING USING ODS DESTINATION AND PROCEDURES
This section samples selected ODS destinations that demonstrate next-level reporting capabilities.
Some of the strengths include being accessible, secure, stylistic, and customizable. We will look at the
strengths of some of the destinations such as HTML, Excel, PDF, and PowerPoint combined with other
items within the ODS ecosystem.
NEXT LEVEL HTML
The HTML format is great for providing information that can be shared regardless of the device or
operating system. One of the greatest features of the HTML format is its’ accessibility support.
ODS HTML5 provides accessible output that includes captions for tables, and scope tags for headers
which are used by assistive technologies. The HTML5 destination also has support for accessible
headers using the ODSTEXT procedure. A major benefit of the HTML5 destination is that graphics are
embedded within the web page as a default. The HTML5 destination is very flexible and customizable
and provide many methods of enhancing output. Some items include adding sticky headers, including a
Viewport meta tag, creating dashboards using ODS Layout. This section will discuss a few of these
enhancements to the file.
Adding Sticky Headers
A technique for freezing table headers can be done using a JavaScript library or Cascading Style Sheets
using the stylesheet property Sticky-header. This style property locks the column headers while scrolling
long tables. A simple method of providing this style property to the HTML file is using the HEADTEXT=
ODS HTML5 option. When the statement has been added, the value is added to the header section of the
HTML file.
headtext="<style> thead {position: sticky;top:0 }</style>";
Using Viewport to Control Display
Controlling the display of HTML on mobile devices can be done using the Viewport meta tag. This tag can
be added using the METATEXT= option on the ODS HTML/HTML5 statements. The NAME= parameter
specifies the value Viewport and the CONTENT= specifies the dimension of the device. Specifying the
viewport allows the display to fit nicely depending on the device such as an iPhone. The METATEXT=
ODS HTML5 can also add other content such as the content security policy which is more generally
added to headers.
metatext='name="viewport" content="width=device-width, initial-scale=1"';
Accessibility Features
Accessibility is the strength of the HTML5 format. Accessible headers can be added to HTML files using
the PROC ODSTEXT procedure. The H1-H6 statements within the ODSTEXT procedure are used to add
headers which are expected by assistive technologies. There is also the SAS Graphics Accelerator which
can be used with HTML5 that enables you to explore the graph and data within the graph in various
interactive ways. Using the ACCESSIBLEGRAPH system option enables the graph to be read,
interpreted and amplified by the SAS Graphics Accelerator. The following ODSTEXT procedure
demonstrates generating accessible headers with the ODS HTML5 destination and creating alternate text
with the PROC SGPLOT procedure.
proc odstext;
h1 "This header uses the H1 tag";
h2 "This header uses the H2 tag";