ods advanced topics
Download
Skip this Video
Download Presentation
ODS: Advanced Topics

Loading in 2 Seconds...

play fullscreen
1 / 41

ODS: Advanced Topics - PowerPoint PPT Presentation


  • 99 Views
  • Uploaded on

ODS: Advanced Topics. ODS is constantly improving. support.sas.com/base/rnd. ODS Tip Sheets. On R&D 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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'ODS: Advanced Topics' - topper


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
ods is constantly improving
ODS is constantly improving

support.sas.com/base/rnd

ods tip sheets
ODS Tip Sheets
  • On R&D 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
beyond the basics custom html
Beyond The Basics: Custom HTML

toosmall

notitalic

too big

beyond the basics custom html1
Beyond The Basics: Custom HTML

ODS HTML BODY=\'overtime.html\';

title \'<H1>Overtime Billing for Contract Job Type</H1>\';

footnote \'<FONT SIZE=2>Overtime defined as >10 hours</FONT>\';

proc print data=Billings noobs label

where Hours>8;

label Hours=\'<I>Overtime Hours</I>\';

var WorkDate JobType Hours;

run;

ODS HTML CLOSE;

adding page x of y to rtf reports
Adding Page X of Y to RTF Reports

OPTIONS NONUMBER;

ODS ESCAPECHAR=\'^\';

title justify=center \'Data Set CLIPS\'

justify=right \'Page ^{pageof}\';

adding page x of y to rtf reports2
Adding Page X of Y to RTF Reports
  • To get a different format, use thispage and lastpage instead of pageof

title justify=center \'Data Set CLIPS‘

justify=right \'Page ^{thispage}/^{lastpage}\';

adding a static dates
Adding a Static Dates
  • To insert the date the program was run

ODS RTF FILE=\'StaticDate.rtf\' SASDATE;

adding text
Adding Text

ODS TEXT ‘Insert your text’;

adding text1
Adding Text

ODS ESCAPECHAR=\'^\';

ODS RTF FILE=\'AddText.rtf\' STARTPAGE=OFF;

* procedure goes here;

ODS TEXT=\'^S={LEFTMARGIN=1in RIGHTMARGIN=1in}This 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;

beyond the basics adding more complex text
Beyond the Basics: Adding More Complex Text

ODS ESCAPECHAR=\'^\';

ODS RTF FILE=\'ReportWithText.rtf\' STARTPAGE=OFF;

ODS RTF TEXT=\'^{style[font_style=italic fontweight=bold fontsize=14pt] This bold, italicized text in 14pt introduces the table. Use ^n^n to insert blank lines to start a new paragraph}\';

* proc corr goes here;

ODS RTF TEXT=\'^n^n^n^n^S={font=(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=\'^S={fontweight=bold textdecoration=underline}This bold, underlined sentence concludes the report.\';

ODS RTF CLOSE;

beyond the basics adding hyperlinks to rtf output
Beyond the Basics: Adding Hyperlinks to RTF Output

ODS ESCAPECHAR=’^’;

ODS RTF FILE=\'Hyperlink.rtf\';

proc freq data=clips;

table compete;

run;

ODS RTF TEXT=\'^S={URL="http://www.myweb.com"}Source: ^S={FOREGROUND=blue}www.myweb.com\';

ODS RTF CLOSE;

adding a table of contents
Adding a Table of Contents

ODS RTF FILE=\'PayrollTOC.rtf\' CONTENTS=yes TOC_DATA;

adding a table of contents1
Adding a Table of Contents

ODS RTF FILE=\'PayrollTOC.rtf\' CONTENTS=yes TOC_DATA;

ODS PROCLABEL \'Human Resources Report on Salary and Hours\';

proc tabulate data=hr;

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)*f=dollar8.);

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)*f=3.);

run;

ODS RTF CLOSE;

adding a table of contents2
Adding 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”.

creating bookmarks in your pdf file
Creating bookmarks in your PDF file

title \'Analysis of Consumer Complaints\';

ODS PDF FILE=\'ComplaintAnalysis.pdf\';

proc glm data=Complaints;class product location;model NumComplaints=Product Location;

run;

ODS PDF CLOSE;

Bookmarks are automatic – no code change needed!

creating bookmarks in your pdf file2
Creating bookmarks in your PDF file

title \'Analysis of Consumer Complaints\';

ODS PDF FILE=\'ComplaintAnalysis.pdf\';

ODS PROCLABEL ’Analysis of Consumer Complaints’;

proc glm data=Complaints;class product location;model NumComplaints=Product Location;

run;

ODS PDF CLOSE;

creating bookmarks in your pdf file3
Creating bookmarks in your PDF file

Bookmark options: check out CONTENTS, PDFTOC, BOOKMARKGEN and BOOKMARKLIST

creating pdf with hyperlinks and annotations
Creating PDF with hyperlinks and annotations

ODS PDF FILE=\'AnnotatedReport.pdf\';

proc report data=gallery 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;

another means of creating hyperlinks and annotations
Another means of creating hyperlinks and annotations

ODS ESCAPECHAR=\'^\';

ODS PDF FILE=\'HyperlinkedReport.pdf\';

footnote \'^{style[URL="http://threeartgalleries.info"]Click for more gallery info}\';

proc tabulate data=gallery;

class gallery;

var price;

tables gallery,price*

(n*f=5. (mean min max)*f=dollar8.);

run;

ODS PDF CLOSE;

another means of creating hyperlinks and annotations2
Another means of creating hyperlinks and annotations

ODS ESCAPECHAR=\'^\';

proc format;

value $galft

\'East Side\'=\'^{style[FLYOVER= "130 East 23rd"]East side}‘

\'Downtown\'=\'^{style[FLYOVER=

"10 Elm Street"]Downtown}‘

\'Mall\'=\'^{style[FLYOVER=

"Southside Mall Blvd"]Mall}\';

run;

adding page x of y to pdf
Adding Page X of Y to PDF

ODS ESCAPECHAR=\'^\';

ODS PDF FILE="Footnotes.pdf";

footnote justify=left \'Page ^{thispage} of ^{lastpage}\';

footnote2 \'Page -^{thispage}-\' ;

footnote3 \'Total Pages: ^{lastpage}\';

footnote5 justify=left \'Seite ^{thispage} von ^{lastpage}\';

footnote7 justify=left \'Página ^{thispage} de ^{lastpage}\';

footnote8 \'^{pageof}\';

proc print data=gallery(obs=20);

run;

ODS PDF CLOSE;

adding page x of y to pdf1
Adding Page X of Y to PDF

Doesn’t work for PDF, only RTF

further reading sgf papers
Further reading: SGF papers
  • http://support.sas.com/rnd/base/ods/odsmarkup/pandp.html
    • ODS Markup and Tagsets, a Tutorial
    • ODS and Office Integration
    • ODS MARKUP: The SAS Reports You\'ve Always Dreamed Of
summary
Summary
  • This was a whirlwind tour of some useful advanced topics
  • There are many more
  • Questions:
ad