Title: ODS:%20Advanced%20Topics
1ODS Advanced Topics
2ODS is constantly improving
3ODS Tip Sheets
- On RD site
- ODS Basics and ODS HTML
- ODS PDF
- ODS RTF
- Using ODS Style Syntax with PROC PRINT, REPORT
and TABULATE - Style Template Syntax
- Table Template Syntax
- ODS DOCUMENT
4Beyond The Basics Custom HTML
toosmall
notitalic
too big
5Beyond The Basics Custom HTML
- ODS HTML BODY'overtime.html'
- title 'ltH1gtOvertime Billing for Contract Job
Typelt/H1gt' - footnote 'ltFONT SIZE2gtOvertime defined as gt10
hourslt/FONTgt' - proc print dataBillings noobs label
- where Hoursgt8
- label Hours'ltIgtOvertime Hourslt/Igt'
- var WorkDate JobType Hours
- run
- ODS HTML CLOSE
6Beyond The Basics Custom HTML
bigger
italic
smaller
7Adding Page X of Y to RTF Reports
- OPTIONS NONUMBER
- ODS ESCAPECHAR''
- title justifycenter 'Data Set CLIPS'
- justifyright 'Page pageof'
8Adding Page X of Y to RTF Reports
Alt-F9
9Adding Page X of Y to RTF Reports
- To get a different format, use thispage and
lastpage instead of pageof - title justifycenter 'Data Set CLIPS
- justifyright 'Page thispage/lastpage'
10Adding a Static Dates
- To insert the date the program was run
- ODS RTF FILE'StaticDate.rtf' SASDATE
11Adding Text
- ODS TEXT Insert your text
12Adding Text
- ODS ESCAPECHAR''
- ODS RTF FILE'AddText.rtf' STARTPAGEOFF
- procedure goes here
- ODS TEXT'SLEFTMARGIN1in RIGHTMARGIN1inThis
text was inserted with the TEXT option. It can
be used to add a detailed explanatory caption
below a table or figure. This example uses an
inline formatting escape sequence to apply
different styles here. This text can also be
formatted by using PROC TEMPLATE and the usertext
style element' - ODS RTF CLOSE
13Adding Text
14Beyond the Basics Adding More Complex Text
- ODS ESCAPECHAR''
- ODS RTF FILE'ReportWithText.rtf' STARTPAGEOFF
- ODS RTF TEXT'stylefont_styleitalic
fontweightbold fontsize14pt This bold,
italicized text in 14pt introduces the table. Use
nn to insert blank lines to start a new
paragraph' - proc corr goes here
- ODS RTF TEXT'nnnnSfont(Arial) This
sentence in Arial says that four lines were
inserted before this sentence and that a bar
chart follows' - proc gchart goes here
- ODS RTF TEXT'Sfontweightbold
textdecorationunderlineThis bold, underlined
sentence concludes the report.' - ODS RTF CLOSE
15Beyond the Basics Adding More Complex Text
16Beyond the Basics Adding Hyperlinks to RTF Output
- ODS ESCAPECHAR
- ODS RTF FILE'Hyperlink.rtf'
- proc freq dataclips
- table compete
- run
- ODS RTF TEXT'SURL"http//www.myweb.com"Sourc
e SFOREGROUNDbluewww.myweb.com' - ODS RTF CLOSE
17Beyond the Basics Adding Hyperlinks to RTF Output
18Adding a Table of Contents
- ODS RTF FILE'PayrollTOC.rtf' CONTENTSyes
TOC_DATA
19Adding a Table of Contents
- ODS RTF FILE'PayrollTOC.rtf' CONTENTSyes
TOC_DATA - ODS PROCLABEL 'Human Resources Report on Salary
and Hours' - proc tabulate datahr
- class department category
- var annualsalary hoursweek
- tables department'Annual Salary Statistics for
' - all'Annual Salary Statistics in All
Departments and Categories', - (category all'All Categories in
Department'), - annualsalary( (n mean min median
max)fdollar8.) - tables department'Hours per Week Statistics
for ' all - 'Hours per Week Statistics for All
Departments and Categories', - (category all'All Categories in
Department'), - hoursweek( (n mean min median
max)f3.) - run
- ODS RTF CLOSE
20Adding a Table of Contents
To generate the TOC right click on TOC and
select update field. If TOC not showing, click
View and then Show Paragraph Marks.
21Adding a Table of Contents
22Beyond the Basics Enhancing RTF using RTF
Control Words and Field Codes
Style RTF Control Word(s) Quoted String in TITLE or FOOTNOTE Statement
Bold Italicize \b \i "\b\i0 Bold \b0 \i Italicize"
Bullet \bullet "\bullet Bullet"
Double strike \striked1 "\striked1 Double Strike \striked0 Regular Words"
Double underline \dul "\uldb Double Underline \uldb0"
Engrave \impr "\impr Engrave"
Subscript \sub "Subscript \sub 1"
Superscript \super "Superscript \super 2"
Outline \outl "\outl Outline"
Shadow \shad "\shad Shadow"
Foreground color \cfn "\cf1 Foreground1 \cf2 Foreground2 \cf3 Foreground3"
Wave underline \ulw "\ulwave Wave underline"
Thick underline \ulth "\ulth Thick Underline"
Font size in half points \fs24 "\fs48 Font Size in half points size 48 will be 24pt in the document"
title "raw ltstringgt"
23Beyond the Basics Enhancing RTF using RTF
Control Words and Field Codes
24Creating bookmarks in your PDF file
- title 'Analysis of Consumer Complaints'
- ODS PDF FILE'ComplaintAnalysis.pdf'
- proc glm dataComplaintsclass product
locationmodel NumComplaintsProduct Location - run
- ODS PDF CLOSE
Bookmarks are automatic no code change needed!
25Creating bookmarks in your PDF file
26Creating bookmarks in your PDF file
- title 'Analysis of Consumer Complaints'
- ODS PDF FILE'ComplaintAnalysis.pdf'
- ODS PROCLABEL Analysis of Consumer Complaints
- proc glm dataComplaintsclass product
locationmodel NumComplaintsProduct Location - run
- ODS PDF CLOSE
27Creating bookmarks in your PDF file
Bookmark options check out CONTENTS, PDFTOC,
BOOKMARKGEN and BOOKMARKLIST
28Creating PDF with hyperlinks and annotations
- ODS PDF FILE'AnnotatedReport.pdf'
- proc report datagallery nowd
- column artist medium price
- define artist / group STYLE(Header)
- URL"http//www.artistlookupwebsite.com/"
- define medium / group STYLE(Header)
- URL"http//www.artistmediumlookup.com"
- define price / analysis mean STYLE(Header)
- FLYOVER"Prices listed in US"
- run
- ODS PDF CLOSE
29Creating PDF with hyperlinks and annotations
30Creating PDF with hyperlinks and annotations
31Another means of creating hyperlinks and
annotations
- ODS ESCAPECHAR''
- ODS PDF FILE'HyperlinkedReport.pdf'
- footnote 'styleURL"http//threeartgalleries.i
nfo"Click for more gallery info' - proc tabulate datagallery
- class gallery
- var price
- tables gallery,price
- (nf5. (mean min max)fdollar8.)
- run
- ODS PDF CLOSE
32Another means of creating hyperlinks and
annotations
33Another means of creating hyperlinks and
annotations
- ODS ESCAPECHAR''
- proc format
- value galft
- 'East Side''styleFLYOVER "130 East
23rd"East side - 'Downtown''styleFLYOVER
- "10 Elm Street"Downtown
- 'Mall''styleFLYOVER
- "Southside Mall Blvd"Mall'
- run
34Another means of creating hyperlinks and
annotations
35Adding Page X of Y to PDF
- ODS ESCAPECHAR''
- ODS PDF FILE"Footnotes.pdf"
- footnote justifyleft 'Page thispage of
lastpage' - footnote2 'Page -thispage-'
- footnote3 'Total Pages lastpage'
- footnote5 justifyleft 'Seite thispage von
lastpage' - footnote7 justifyleft 'Página thispage de
lastpage' - footnote8 'pageof'
- proc print datagallery(obs20)
- run
- ODS PDF CLOSE
36Adding Page X of Y to PDF
Doesnt work for PDF, only RTF
37Tagsets and Reporting
38Tagsets and Reporting
39Tagsets and Reporting
40Further reading SGF papers
- http//support.sas.com/rnd/base/ods/odsmarkup/pand
p.html - ODS Markup and Tagsets, a Tutorial
- ODS and Office Integration
- ODS MARKUP The SAS Reports You've Always Dreamed
Of
41Summary
- This was a whirlwind tour of some useful advanced
topics - There are many more
- Questions
- info_at_laurenhaworth.com
- Or buy the book! ?