SAS coding used in creating a routine report February 23, 2009 February is Heart Month.

Slides:



Advertisements
Similar presentations
Change font face Change font size Align left.
Advertisements

Microsoft Word By: Phuong Nguyen.
Outline Proc Report Tricks Kelley Weston. Outline Examples 1.Text that spans columnsText that spans columns 2.Patient-level detail in the titlesPatient-level.
Microsoft Office 2003 Illustrated Brief Elements to a Document Adding Special.
Pasewark & Pasewark 1 Word Lesson 7 Working with Documents Microsoft Office 2007: Introductory.
CREATING A MULTIPLE PAGE REPORT Presented by: Dr. Ennis-Cole.
Page margin margin for header and footer. page size page orientation.
Word Lesson 7 Working with Documents
Computer Information Technology – Section 4-3 Some text and examples used with permission from:
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2003 Lab 3 Creating Reports and Tables.
Computing Concepts Advanced HTML: Tables and Forms.
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT WORD Lesson 7 – Working With Documents.
HTML Code. What we will cover Basic HTML Body Font Images Hyperlinks Tables Frames.
Beginning with Microsoft Word 2007 Word Icon Microsoft Office Logo.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
7 Selecting Design and Color Section 7.1 Identify presentation design principles Use a custom template Add pages to a navigation structure Section 7.2.
HTML Tables. Start of page where we want to place a table.
Computer Applications I Unit 3 Study Guide 1 Introduction to Formatting, Alignment and Page Setup.
Copyright © 2006, SAS Institute Inc. All rights reserved. Randy Poindexter & Scott Huntley Output Delivery and Reporting An Introduction to ODS.
ULI101: XHTML Basics (Part III) Introduction to XHTML / Continued … Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,,
Use a Large Bold Type for the Main Title Use Smaller Type for the Subtitle. Above type is 96 pt, this type is 66 pt Make Authors’ names smaller. This is.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
CITY UNIVERSITY / Vysoká Škola Manažmentu.:MG Information Systems :. © Martina Cesalova, 2005 MS FRONTPAGE 1 1.Open FrontPage – View -> Page 2.Open.
Excel Part 2 Formatting a Workbook. XP Objectives Format text, numbers, and dates Change font colors and fill colors Merge a range into a single cell.
SAS PROC REPORT PROC TABULATE
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
Website Development with Dreamweaver
Basic HTML Workshop By: Preeda Chunjongkolkul (Pete) Systems Librarian/Webmaster
Microsoft Word 2013 Bob Gill
The switch from Microsoft Office 2003 to 2007 Microsoft Word Microsoft Excel Microsoft PowerPoint.
CPG 4331 Class Agenda Word  Getting Started  Editing Documents  Changing Views in Documents  Format Text / Format Documents  Work With Tables  Work.
1 Lesson 18 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Word 2013 Certification Skills Measured. 1. Create and Manage Documents  Create a Document  Navigate through a Document  Format a Document  Customize.
Formatting Documents Lesson 2 Microsoft Word. Apply Paragraph and Character styles Formatting has to do with the appearance of a document. In Word entire.
1 Word Lesson 3 Formatting Documents Microsoft Office 2010 Fundamentals Story / Walls.
Copyright 2006 South-Western/Thomson Learning Chapter 12 Tables.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
CIS234A Lecture 8 Instructor Greg D’Andrea. Review Text Table contains only text, evenly spaced on the Web page in rows and columns uses only standard.
IWorks Pages. Word Processing  Software that is designed for the entry, editing, and printing of documents.  Mac Version = iWorks Pages  As with Microsoft.
1 Lesson 13 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
By: Ms. Abeer Helwa 1. WORD WEB APP 2 Word Web App is a limited version of Word, enabling you to edit, format, and share documents online. Word Web App.
The Basics of Microsoft Word Getting Started and Formatting your paper.
1 Word Lesson 4 Working with Graphics Microsoft Office 2010 Introductory Pasewark & Pasewark.
By: Ms. Abeer Helwa 1. WORD WEB APP 2 Word Web App is a limited version of Word, enabling you to edit, format, and share documents online. Word Web App.
Lecture 3- Microsoft Word COE 201- Computer Proficiency.
Introduction to Technology. Parts of MSWord Screen Title Bar Quick Access Toolbar Button Ribbon Status Bar (views and zoom)
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
Microsoft® Access Generate forms quickly 1 Modify controls in Layout View 2 Work with form sections 3 Modify controls in Design View 4 Add calculated.
HTML Tags BTT1O. HTML  Documents written in hypertext markup language can be interpreted by all web browsers.  This language lets the web page developer.
To create text styles click on Home >> Tab under Change Styles
1 SAS ® ODS Technology for Today’s Decision Makers Sunil Gupta Quintiles.
1 Word Processing Intermediate Using Microsoft Office 2000.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
DAY 25: WORD CHAPTER Rohit March 28,
A MORE COMPLETE ODS REPORT. What we’re going to talk about…  Creating a title page  Creating an introduction page  Creating long-form text descriptions.
Mr. Marino – 6th Grade Computer Applications
Chapter 17: Document Production (Word)
Permeability (% of Control)
Permeability (% of Control)
Microsoft Office 2007-Illustrated
Word Lesson 7 Working with Documents
Practice Activity – Part 1
Formatting a Research paper
Use a Large Bold Type for the Main Title (80 pt):
Permeability (% of Control)
Use a Large Bold Type for the Main Title (80 pt):
Use a Large Bold Type for the Main Title (70 pt):
Permeability (% of Control)
Use a Large Bold Type for the Main Title (70 pt):
Presentation transcript:

SAS coding used in creating a routine report February 23, 2009 February is Heart Month

How it all started…  Create a monthly report that includes: Tables with accompanying text Graphs with accompanying text Background introduction to the report Table of contents Title page

ODS RTF file=‘pathname/filename.rtf’; {SAS statements} ODS RTF close; ODS RTF to create the output file

How to…?  Format text  Insert special characters  Format headers and footers  Format a table  Insert pictures/graphs  Call in an R program from SAS Stress-busting tip for a healthy heart: Laugh. It’s your body’s natural stress-release mechanism

Basic formats in TITLE  TITLE and FOOTNOTE have some basic formats styles available using keywords: Bold Background/Foreground colour Font sizes Font types Text justification Underlining TITLE justify=r bold color=blue bcolor=red font=arial height=10 underlin=1 ‘put text here!’;

Format keywords in PROC REPORT  Similar to TITLE but some keywords differ PROC REPORT data=notes style(header)=[background=STG foreground=white just=center font_size=9pt font_face='arial' font_weight=bold]; column text; define text / style={foreground=black background=yellow cellwidth=10 cm font_size=11pt font_face='arial'}; run;

ODS ESCAPECHAR  Define a special character to indicate RTF elements Choose a character that is not commonly used in SAS coding ODS ESCAPECHAR = ‘^’; {SAS coding} DATA notes; length text $32767; text="^R'{\b\i Put text here! }’ ^R'super\1’ "; run; Put text here! 1

RTF control words  Control word – specially formatted command that RTF uses to mark printer control codes and information

RTF control symbols and groups  Control symbol – backslash followed by a single, non-alphabetic character Example: \~ for non-breaking space  Groups – text and control words or control symbols between braces, {}

Specify style elements  Specify ODS ESCAPECHAR  Basic form: ^S={style attributes} ^S={indent=0.45cm cellwidth=20cm font_face='arial' font_size=11pt}

Adding text into RTF file  TITLE adds text to top of page  FOOTNOTE adds text to bottom of page  How about adding text to the middle of the page or blocks of text? ODS RTF TEXT PROC REPORT

ODS RTF TEXT  Add text before/after a PROCedure ODS RTF TEXT = “Add text here";  Add formatting using STYLE: ODS RTF TEXT = "^S={} {Add in text here.}"; ODS RTF TEXT = "^S={indent=0.45cm cellwidth=20cm font_face='arial' font_size=11pt}{Add in text here.}";

 For larger blocks of text  PROC REPORT  Basic PROC REPORT PROC REPORT data=notes; column text; define text / display; run; Adding text using PROC REPORT ODS ESCAPECHAR=‘^’; ODS RTF file=‘pathname/sample.rtf’; PROC REPORT data=notes noheader center nowd; column text; define text / width=96 flow style={foreground=black background=white cellwidth=17.75cm font_size=11pt font_face='arial'}; run; ODS RTF close;

Creating text in a DATA step DATA notes; length text $32767; text=“Insert text here”; run; DATA notes; length text $32767; text= ^S={font_weight=bold font_size=14pt foreground=STG}^R'\qc' Insert centered bolded text here and add a new line ^n ^S={}"|| "^R'\par\ql' Begin a left justified paragraph. "|| “Add in more text and then add 2 lines. ^n^n”; run;

How to…?  Format text  Insert special characters  Format headers and footers  Format a table  Insert pictures/graphs  Call in an R program from SAS Healthy-eating for a healthy heart. Choose fresh fruit over juice.

Special Characters From START menu: Programs > Accessories > System Tools > Character Map Copy/Paste symbol into SAS editor If symbol pastes as ‘?’ then it will not display properly

How to…?  Format text  Insert special characters  Format headers and footers  Format a table  Insert pictures/graphs  Call in an R program from SAS A truffle a day lowers blood pressure. Choose chocolate with cocoa content of 70% or higher.

Headers & Footers  Format text in TITLE and FOOTNOTE using keywords (ie. bold, bcolor=, underlin=, font=) or in-line formatting  Insert pictures using PREIMAGE JPG, GIF and PNG  Create sections by using the justification format code just=center(c), left(l), right(r)

Headers & Footers FOOTNOTE j=r "^S={font=(‘arial’, 12pt, bold) Insert bold text here.}"; TITLE j=l "^S={preimage='W:\Reports\image1.png'}" j=r "^S={preimage='W:\Report\image2.png'}";

How to…?  Format text  Insert special characters  Format headers and footers  Format a table  Insert pictures/graphs  Call in an R program from SAS Stress-busting tip for a healthy heart. Take time for yourself.

Format a table – PROC REPORT  Format rows & columns  Add subscripts to text  Highlight cells based on a conditional statement

Data setup for formatted table  PROC TABULATE, PROC TRANSPOSE and DATA step to arrange data  Merge with dataset containing: Variable labels (varlabel) to create formatted text in table (note: RTF control words to format) Categories for grouping variables Variable (npage) to identify where to split table

PROC REPORT table PROC REPORT data=dproc2 nowd; column npage category varlabel maxrate ("Hospital Completion %" SiteA SiteB SiteC SiteD SiteE); define npage/ group noprint; define category/ group noprint order=data; define varlabel / display ‘Data Field' center; define maxrate … run;

Adding formats to PROC REPORT PROC REPORT data=dproc2 nowd center style(header)=[background=STG foreground=white just=center font_size=9pt font_face='arial' font_weight=bold] style(lines)=[font_size=9pt font_face='arial' just=l font_weight=bold indent=0.2 cm] style(column)=[font_size=9pt font_face='arial' cellwidth=2 cm]; …

Formatting specific columns PROC REPORT data=sample_data nowd center … define varlabel/ display order=data 'Data Field' left style(column)=[cellwidth=7.3 cm indent=0.9 cm]; define maxrate/ display 'Highest Completion %' center style(column)=[foreground=STG font_weight=bold cellwidth=2.7 cm]; run;

Conditional formatting PROC REPORT data=dproc2 nowd center … compute varlabel; if varlabel='Number of Cases' then call define(_ROW_, "style","style=[background =PALG font_weight=bold font_style=italic]"); endcomp; %traffic_lighting (SiteA SiteB SiteC SiteD SiteE maxrate, 6); break after npage/ page; run;

Traffic Lighting %macro traffic_lighting (var, nvar); %do i=1 %to &nvar; %let rvar=%scan(&var,&i); compute &rvar; if 0<= &rvar <50 then call define (_COL_, "STYLE", "style=[background=dark red foreground=white font_weight=bold]"); if 50 <= &rvar < 90 then call define(_COL_, "STYLE", "STYLE=[background=gold foreground=black font_weight=bold]"); endcomp; %end; %mend traffic_lighting;

How to…?  Format text  Insert special characters  Format headers and footers  Format a table  Insert pictures/graphs  Call in an R program from SAS Nuts and seeds are high in heart healthy fat. Be sure to reduce other added fats if including nuts and seeds in your diet

Adding in a picture in ODS RTF DATA cover_page; list='^S={preimage="W:\Reports\cover_image.png"}'; PROC REPORT data=cover_page noheader nowd style={frame=void}; define list /style={cellwidth=21 cm} center; run;

How to…?  Format text  Insert special characters  Format headers and footers  Format a table  Insert pictures/graphs  Call in an R program from SAS Keep active and maintain a healthy weight. Taking the stairs burns 5x as many calories as taking the elevator.

Call an R program from SAS OPTIONS XWAIT XSYNC ; DATA _null_; X """C:\Program Files\R\R.exe"" --no-save --quiet ""W:\graphs.log"""; infile 'W:\graphs.log'; file log; input; put '**R: ' _INFILE_; run;

Creating the output file ODS ESCAPECHAR='^'; ODS RTF file=‘filename‘ startpage=no; {Create cover page} ods rtf startpage=now; {Insert background text} … ODS RTF close;

THANKS!