Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reporting The Facts: The ODSmemo macro suite for making reproducible RTF memos within SAS® Rocio Lopez Cleveland Clinic.

Similar presentations


Presentation on theme: "Reporting The Facts: The ODSmemo macro suite for making reproducible RTF memos within SAS® Rocio Lopez Cleveland Clinic."— Presentation transcript:

1 Reporting The Facts: The ODSmemo macro suite for making reproducible RTF memos within SAS® Rocio Lopez Cleveland Clinic

2 Background We already use SAS® to generate report ready tables and figures Why not use it to generate a full reproducible memo that is ready to send to clients?

3 ODS RTF Allows sending SAS® output to RTF documents Can also send raw text Styling options can be easily controlled RTF control words SAS in-line formatting Style template

4 ODS RTF Styling FunctionIn-line formattingRTF control words Control Font ^S={font_face=‘Times Roman’ font_size=11pt} ^R/RTF’\froman\fs22’; Add superscript ^{super text}^R/RTF’\super’; text; Add new line ^{newline 1}^R/RTF’\line’; Insert ≤ ^{unicode 2264}^R/RTF’\u8804\bin’;

5 How Can You Easily Generate a Memo? With the ODSmemo Macro Suite %StartMemo(options); %AddSection(options); %AddTable(options); %AddFigure(options); %CloseMemo;

6 %StartMemo: Header (1) %StartMemo( HeaderLogo = cc_logo.jpg, HeaderInfo = qhs_header.txt, To = "John Smith, MD|Jane Doe, MD", Department = "Department of Gastroenterology", PreparedBy = "Rocio Lopez, MS", Re = "Sample Memo Writing with ODS RTF", Introduction = "This is a sample memo generated using ODSmemo Macro Suite.", RTFFile = folder_path/SampleMemo); Date SAS session began

7 %StartMemo: Footnote (2) %StartMemo( …, PersonalFooter=1, Email=lopezr@ccf.org Tel=012-345-6789); Add your contact information in the footnote File path

8 %AddSection: Add paragraphs (3) %AddSection( Header= “Aim.”, Text= “The aim of this memo is to show the use of the ODSmemo Macro Suite.”);

9 Use of Special Characters (3) %AddSection( Header="Statistical Analysis.", Text="Descriptive data are presented as means &PLMi. SD…);

10 Use of Special Characters (3) Macro Parameter NamePurpose leInsert ≤ symbol geInsert ≥ symbol NotEqualInsert ≠ symbol muInsert µ symbol alphaInsert α symbol PlMiInsert ± symbol

11 Defined Macro Variables Macro Parameter NamePurpose NewLineInsert new line TabInsert tab BoldTurn on bold font BoldOffTurn off bold font UnderlineTurn on underline UnderlineOffTurn off underline ItalicsTurn on italics ItalicsOffTurn off italics SuperscriptSuperscript following text. SubscriptSubscript following text Super_Sub_OffTurn off superscript/subscript BulletInsert bullet point TabBulletInsert indented bullet point PageBBPage break before section

12 Incorporate your SAS® results in the text (3) %AddSection( Header="Results.", Text="A total of &N. subjects … approximately &HtBeta. lbs (p &p.).");

13 Add tables (4) SAS® macros that generate formatted tables PROC REPORT or other reporting procedure

14 Add Tables: %AddTable (5) %AddTable( ds= Table2, Title= "Table 2: Linear Regression Analysis", LabelCol= Variable, Columns= Estimate_SE pfmt, Footnote= "Adjusted R&superscript.2&super_sub_off. &AdRSq..&newline. SE:standard error", Cwidth1= 150, Cwidth2= 150); SAS data set Width of LabelCol Width columns

15 Add Figures External figures (6) %AddFigure( Title=“Figure 1”, FigFile=file_path/Fig1.png, NewPage=1); SAS figures (7) ODS GRAPHICS SAS GRAPHICS procedures such as SGPLOT

16 %CloseMemo Close the ods destination so file can be populated. %CloseMemo;

17 Conclusion ODS is a useful and powerful tool for directing SAS® output using a reader friendly format. The ODSmemo macros suite takes advantage of these features and is a way to easily generate reproducible statistical reports

18 Full Source Code Download ODSmemo macro suite and full code for example at: http://www.sascommunity.org/wiki/User:Lopezr

19 Questions?

20 Contact Information Name: A. Rocio Lopez Enterprise: Cleveland Clinic Address: 9500 Euclid Ave/JJN3-01 City, State ZIP: Cleveland OH 44195 E-mail: lopezr@ccf.org


Download ppt "Reporting The Facts: The ODSmemo macro suite for making reproducible RTF memos within SAS® Rocio Lopez Cleveland Clinic."

Similar presentations


Ads by Google