An Introduction to ODS

An Introduction to ODS
Randy Poindexter & Scott Huntley
Output Delivery and Reporting
Copyright © 2006, SAS Institute Inc. All rights reserved.
Agenda
 Why
 What
 Online resources
 Q&A
Copyright © 2006, SAS Institute Inc. All rights reserved.
Copyright © 2006, SAS Institute Inc. All rights reserved.
Some Isn’t Good Enough
 Some procedures output some data sets.
 Data sets contain some analysis results.
Copyright © 2006, SAS Institute Inc. All rights reserved.
Output Delivery System (ODS) Benefits
1. Integrate your output.
2. Customize content of your output.
3. Customize appearance of your output.
Copyright © 2006, SAS Institute Inc. All rights reserved.
Integrate Your Output
Copyright © 2006, SAS Institute Inc. All rights reserved.
HTML For the Web
Copyright © 2006, SAS Institute Inc. All rights reserved.
PDF for Portable Printing
Copyright © 2006, SAS Institute Inc. All rights reserved.
RTF for Microsoft Word
Copyright © 2006, SAS Institute Inc. All rights reserved.
XML for
Integration
Copyright © 2006, SAS Institute Inc. All rights reserved.
Scalable Vector Graphics
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<g>
<rect x="0" y="0" width="815" height="1056" style="fill: #FFFFFF; fill-rule: evenodd; " />
<rect x="0" y="0" width="815" height="1056" style="fill: #FFFFFF; fill-rule: evenodd; " />
<rect x="256" y="72" width="302" height="45" style="fill: #BBBBBB; fill-rule: evenodd; " />
<rect x="256" y="118" width="64" height="25" style="fill: #BBBBBB; fill-rule: evenodd; " />
<rect x="321" y="118" width="136" height="25" style="fill: #BBBBBB; fill-rule: evenodd; " />
<rect x="458" y="118" width="100" height="25" style="fill: #BBBBBB; fill-rule: evenodd; " />
<rect x="256" y="144" width="64" height="25" style="fill: #BBBBBB; fill-rule: evenodd; " />
<rect x="256" y="170" width="64" height="25" style="fill: #BBBBBB; fill-rule: evenodd; " />
<rect x="256" y="196" width="64" height="24" style="fill: #BBBBBB; fill-rule: evenodd; " />
<text x="551" y="9" style="stroke: #000000; fill: #000000; font-family: 'SAS Monospace'; fontsize: 10pt; " >10:22 Friday, October 29, 2004</text>
Copyright © 2006, SAS Institute Inc. All rights reserved.
XLS for Microsoft Excel
Copyright © 2006, SAS Institute Inc. All rights reserved.
Data Sets for Downstream Processing
Copyright © 2006, SAS Institute Inc. All rights reserved.
ActiveX Graphs
for Microsoft
Apps
Copyright © 2006, SAS Institute Inc. All rights reserved.
Java
Graphs
For
Portability
Copyright © 2006, SAS Institute Inc. All rights reserved.
ODS Statistical Graphics
Copyright © 2006, SAS Institute Inc. All rights reserved.
Selecting the Tables You Want
Why get 8 tables…
Copyright © 2006, SAS Institute Inc. All rights reserved.
when you really only want 1 ?
Table Structure
Our Way
Your Way
Copyright © 2006, SAS Institute Inc. All rights reserved.
Embedded Images
Copyright © 2006, SAS Institute Inc. All rights reserved.
Embedded
Links
Copyright © 2006, SAS Institute Inc. All rights reserved.
Customize Appearance of Your Output
Copyright © 2006, SAS Institute Inc. All rights reserved.
Styles
Default
BarrettsBlue
Copyright © 2006, SAS Institute Inc. All rights reserved.
Traffic Lighting
Copyright © 2006, SAS Institute Inc. All rights reserved.
Copyright © 2006, SAS Institute Inc. All rights reserved.
Benefits of ODS
1. Integrate your output.
2. Customize content of your output.
3. Customize appearance of your output.
4. Improve your customer satisfaction!
Copyright © 2006, SAS Institute Inc. All rights reserved.
ODS Online Resources
 Base community
http://support.sas.com/rnd/base/ods/index.html
 User forum
http://support.sas.com/forums/forum.jspa?forumID=6
 Online User’s Guide
http://support.sas.com/documentation/cdl/en/odsug/61723
/HTML/default/odsugwhatsnew902.htm
 SAS-L newsgroup
 ods@sas.com
Copyright © 2006, SAS Institute Inc. All rights reserved.
Enhancements to Inline Formatting
in SAS 9.2
Copyright © 2006, SAS Institute Inc. All rights reserved.
compute year;
bg + 1;
if mod(bg, 2) = 1 then
call define(_row_, "style", "style={background=cx494068 color=cxbbb2e0}");
else
call define(_row_, "style", "style={background=cxbbb2e0}");
endcomp;
Copyright © 2006, SAS Institute Inc. All rights reserved.
compute quantity;
if quantity.sum < 400 then
call define (_col_, "style","style=[color=red]");
endcomp;
Copyright © 2006, SAS Institute Inc. All rights reserved.
In-Line Style Syntax
Ods escapechar=< quoted character >;
/* This happens to be the default escape character */
Ods escapechar=“^”;
Copyright © 2006, SAS Institute Inc. All rights reserved.
In-Line Style Function
^{style <style-element-name><[style=attributes]> formatted text}
Copyright © 2006, SAS Institute Inc. All rights reserved.
Elements vs. Attributes
class HeaderStrong /
color = colors('headerfgstrong')
backgroundcolor = colors('headerbgstrong')
font = fonts('StrongFont');
Color  red
Font size  big
Font style  italic
Copyright © 2006, SAS Institute Inc. All rights reserved.
In-Line Style Function
^{style [color = dark blue] text that is dark blue}
Copyright © 2006, SAS Institute Inc. All rights reserved.
In-Line Style Function
^{style SystemTitles [color=red] System Titles Text that is red}
Copyright © 2006, SAS Institute Inc. All rights reserved.
Titles
title 'You can use styles to set font attributes like
^{style [color=red]color} or ^{style [font_size=20pt]size}';
Copyright © 2006, SAS Institute Inc. All rights reserved.
Nesting of styles
ods text = "black ^{style [color=purple] purple ^{style
[font_style=italic] italic ^{style [fontsize=18pt] big text ^{style
[color=green] green } more} text} one} end";
Copyright © 2006, SAS Institute Inc. All rights reserved.
ods text='^{style[textdecoration=underline color=green
font_style=italic] text with underline}';
Copyright © 2006, SAS Institute Inc. All rights reserved.
Symbols
title 'Unicode symbols are easy to use';
title2 'Converting Dollars to Euros ^{unicode 0024}1 = ^{unicode 00AC}0.1794';
title3 'Converting Pounds to Yen ^{unicode 00A3}1 = ^{unicode 00A5}144.705';
title4 'You can use copyright ^{unicode 00A9} registered ^{unicode 00AE} and
trademarks ^{unicode 2122} too';
Copyright © 2006, SAS Institute Inc. All rights reserved.
Super or Sub scripts
ods text = "^{style [fontsize=18pt] big ^{super text}} or
^{style [fonsize=10pt] small ^{sub text}}";
Copyright © 2006, SAS Institute Inc. All rights reserved.
New Functions – nbspace & newline
title 'nbspace puts spaces between^{nbspace 5}words';
title2 'newline puts line breaks between^{newline 3}words‘;
Copyright © 2006, SAS Institute Inc. All rights reserved.
Individual Border Control
title "^{style [borderwidth=5pt bordertopcolor=red borderbottomwidth=20pt
borderrightstyle=double] Border Control Example}";
Copyright © 2006, SAS Institute Inc. All rights reserved.
Individual Border Control - PDF
title4 "*{style [bordertopwidth=1pt bordertopcolor=green
borderrightwidth=1pt borderrightcolor=light blue] Title 4 } ";
define col1 / "Dose 1 "
style(column)=[borderleftcolor=purple borderrightcolor=red
borderleftwidth=2pt borderrightwidth=2pt];
Copyright © 2006, SAS Institute Inc. All rights reserved.
Copyright © 2006, SAS Institute Inc. All rights reserved.