PROC TEMPLATE: The Basics Lauren Haworth Genentech, Inc. South San Francisco, CA.

Slides:



Advertisements
Similar presentations
Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
FrontPage Express By John G. Summerville Ph.D.©, RN.
Microsoft Word 2013 An Overview. Your Environment Quick Access Toolbar Customizable toolbar for one-click shortcuts Tabs Backstage View Tools located.
Chapter 8 Creating Style Sheets.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
1 CA202 Spreadsheet Application Changing Document Appearance Lecture # 4.
Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 3 – A Professional Looking Worksheet.
Word Processing First Steps
How to Create a Custom Style Sonia Extremera / Antonio Nieto / Javier Gómez PhUSE Annual Conference, 9th-12th Oct 2011, Brighton UK.
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure with HTML.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Introducing Web Tables
XP Creating Web Pages with HTML Using Tables. XP Objectives Create a text table Create a table using the,, and tags Create table headers and captions.
Using HTML Tables.
ABC’s of PowerPoint (Office 2007) Part 1: Basic Vocabulary Part 2: Cursors Part 3: Insert Your Text Part 4: Insert Your Pictures Part 5: Basic Tools &
PowerPoint: Tables Computer Information Technology Section 5-11 Some text and examples used with permission from: Note: We are.
Business Computer Information Systems 1A Test 2: Word Basics, Basic Editing, and Formatting Text Lessons 1, 2, and 5 Microsoft Office XP Test 2 – REVIEW.
Chapter 5 Working with Tables. Agenda Add a Table Assign a Table Border Adjust Cell Padding and Spacing Adjust Cell Width and Height Add Column Labels.
HTML Tables. Start of page where we want to place a table.
Website design Feng Zhao College of Educatioin California State University, Northridge.
Tonga Institute of Higher Education IT 141: Information Systems CS Students Lecture 2: Microsoft Word.
Microsoft ® Office 2007 Get up to speed with the 2007 system Murray State University College of Education:
HTML Comprehensive Concepts and Techniques Second Edition Project 3 Creating Tables in a Web Site.
CITY UNIVERSITY / Vysoká Škola Manažmentu.:MG Information Systems :. © Martina Cesalova, 2005 MS FRONTPAGE 1 1.Open FrontPage – View -> Page 2.Open.
CTRL + Z is your best friend. Use it to undo anything! You can even undo multiple mistakes!
PowerPoint. Basic Vocabulary Slide - Presentation - Slide layout – ► ► ► ► a single page in PowerPoint all the slides for a speech all the slides for.
Microsoft Excel By: Dr. K.V. Vishwanath Professor, Dept. of C.S.E,
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
Website Development with Dreamweaver
More Basic HTML. Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features Add alignments.
15.2 More Basic HTML. More Basic HTML Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features.
COMMON APPLICATION FUNCTIONS Presentation. Bullets  Symbols used to organize data into a list.  This  Is  An  Example  Of  A  Bullet  List.
Microsoft Excel. Today’s Topics Overview of the Excel Screen The Excel Menus: File, Edit, View, Insert, Format, Tools, Data, Window, Help Entering Formulas.
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 10 Creating and Formatting an Excel Worksheet.
U3A Computing Class Leader – Brian Moore Week 5 of 10 weeks. Mondays 4:15 to 5:45 pm Next week is half term then an Inset day So Next lesson is 4 November.
CNIT 132 – Week 7 HTML - Tables. Tables on the World Wide Web A table can be displayed on a Web page either in a text or graphical format. A text table:
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. word 2010 Chapter 3 Formatting Documents.
XP Practical OpenOffice.org Chapter 8 1 Creating a Presentation.
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 11 Organizing the Worksheet.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Create Your Own Webpage. Today’s Class Internet Safety & Privacy Tables Embedding music and video Frames.
Using the new Version 8 Template Procedure for Complete Control of SAS Output Style and Format David Ghan Technical Training Specialist SAS, Canada.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced 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.
Web Foundations TUESDAY, NOVEMBER 19, 2013 LECTURE 31: DREAMWEAVER: MODIFY MENU AND PROPERTY PANEL.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
1 Chapter 7: Customizing and Organizing Project Results 7.1 Combining Results 7.2 Updating Results 7.3 Customizing the Output Style (Self-Study)
HTML Concepts and Techniques Fifth Edition Chapter 4 Creating Tables in a Web Site.
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.
CSE 409 – Advanced Internet Technology 1 DISCUSSION OF BASIC HTML TAGS.
Learning PowerPoint Presenting your ideas as a slide show… …on the computer!
Chapter 3 Automating Your Work. It is frustrating when you have to type the same passage of text repeatedly. For example your name and address. Word includes.
Spiderman ©Marvel Comics Creating Web Pages (part 1)
LINKING WEBPAGES USING HTML HYPERLINKS. Hyperlinks are text strings or images on a webpage which when clicked on, links to another section in the same.
1 Word Processing Intermediate Using Microsoft Office 2000.
Creating a Presentation
Microsoft Excel.
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Learning the Basics – Lesson 1
PowerPoint: Tables and Charts
Microsoft Excel All editions of Microsoft office.
Using Templates and Library Items
Word Processing Software Photo credit: © 2007 JupiterImagesCorporation.
HIBBs is a program of the Global Health Informatics Partnership Learning the Basics of Microsoft Word 2019 and Microsoft office support TFN
Presentation transcript:

PROC TEMPLATE: The Basics Lauren Haworth Genentech, Inc. South San Francisco, CA

Stylish ODS ODS ships with standard styles –Get the job done –Not exactly stylish You can build your own styles –To suit your taste –To meet your business requirements

Today’s Workshop Creating a custom style for your output. Fast-track approach –Just the basics of the syntax –Copy and paste the code you need

HANDS ON: Create HTML output 1.Open SAS v9 using the shortcut with my name on it 2.The first sample program should be open (if not, open c:\workshops\ws112\SampleProgram1.sas) 3.Submit the program

RESULTS

Syntax: the STYLE= option When we issued this ODS command: ODS HTML FILE=‘sample1.html’; We’re really issuing this command: ODS HTML FILE=‘sample1.html’ STYLE=Default;

Syntax: the STYLE= option ODS has a default style it uses for each destination To switch to another style, type in an explicit STYLE= option and specify a style name

Syntax: PROC TEMPLATE This PROC does many things related to ODS Style and Table definitions One key feature: the SOURCE statement –Allows you to view the source code for a style

HANDS ON: use SOURCE statement 1.In SAS, switch back to the program window 2.Use the Open button on the menu bar 3.Select SampleProgram2.sas 4.Review the syntax of the SOURCE statement 5.Submit the program 6.Switch to the log window to see the results

RESULTS more lines of source code!

PROC TEMPLATE source code Skimming through the code, you’ll see: –Many style definitions –Cover colors, fonts, titles, tables, etc. Templates like this are overwhelming to read We’ll look at another tool for understanding styles

HANDS ON: Pop-up Styles 1.In SAS, switch back to the program window 2.Use the Open button on the menu bar 3.Select SampleProgram3.sas 4.Find the ODS MARKUP statement

Tagset: style_popup This code creates HTML using a tagset: ods markup file="sample3.html" tagset=tagsets.style_popup ; The MARKUP destination and tagsets are a whole workshop All you need to know is that this technique creates an HTML file with special features

HANDS ON: Pop-up Styles 1.Submit the program 2.Don’t review the results in SAS 3.Instead, open Internet Explorer and open c:\workshops\ws112\sample3.html

RESULTS If you see the security warning on your output, right click on it, select “Allow blocked content”, and click Yes.

RESULTS Moving the mouse around highlights different parts of the page, and brings up a label for each part of the output. This label shows the style element that controls that part of the output.

RESULTS Clicking on a highlighted part of the output brings up a popup window with the style definition code

HANDS ON: Find this style 1.In SAS, switch back to the log window 2.Scroll up until you find the log for Sample Program 2 3.Scan through the source code for Style Header (the style we found using the popup tool)

RESULTS There’s nothing there. This doesn’t look like the code from the popup. Why? This code references another style “HeadersAndFooters”

RESULTS This still doesn’t look like the code from the popup. References another style (Cell), and two lists fonts() and colors(). Backtracking to find all of these items would be time- consuming The popup style saves this effort. It shows you all of the values in one style element

Changing the fonts

HANDS ON: Creating a Custom Style 1.In SAS, switch back to the program window 2.Use the Open button on the menu bar 3.Select SampleProgram4.sas 4.Find the PROC TEMPLATE statement 5.Find the PARENT= statement

Syntax: PROC TEMPLATE Allows you to define every aspect of a style Can contain hundreds of lines of code. To simplify life, we build styles from existing styles –use the PARENT= statement –only specify the things we want to change

HANDS ON: Copying a Style 1.Go back to Internet Explorer 2.Click on the title of the output 3.Find the popup window (if it’s not visible, it may be minimized) 4.Copy the code for the style SystemTitle 5.Switch back to the SAS program window

HANDS ON: Pasting a Style 1.Insert a blank line below the PARENT= statement 2.Paste the style code there

Changing Typefaces Use the style attribute FONT_FACE= Change to a new value For HTML, can list up to 3 fonts (in case your user doesn’t have your 1 st -choice font) For other destinations, only 1 is used

Changing Typefaces Here are some typefaces to try These are “safe” because most of your users will have them

HANDS ON: Changing Typefaces 1.Edit the font name in the FONT_FACE= attribute for the title style 2.Submit the program 3.View the output in the results window 4.See what changed

HANDS ON: Changing Typefaces Reference:

Changing Typefaces: My Code

Changing Typefaces: My Results

Changing Font Sizes Notice that the title and footnote are the same size. You may want to make the footnote smaller

HANDS ON: Copying Footnote Style 1.Go back to Internet Explorer 2.Click on the footnote of the output 3.Find the popup window (if it’s not visible, it may be minimized) 4.Copy the code for the style SystemFooter 5.Switch back to the SAS program window

HANDS ON: Pasting a Style 1.Insert a blank line above the END statement 2.Paste the style code there

Changing the font size Use the FONT_SIZE attribute The value (5) is an HTML font size You can replace it with another HTML font size, or you can switch to a value in points ( 10pt )

HANDS ON: Font Size 1.Use the style attribute FONT_SIZE= 2.Change the 5 to a new value

Changing the Font Style The footnote looks nice in italic, but the title does not We can fix that now Use the FONT_STYLE attribute Values you can use are italic and roman (non-italic)

HANDS ON: Font Style 1.Go to the SystemTitle style 2.Use the style attribute FONT_STYLE= 3.Change the italic to roman 4.Run the program to see the change in the title and footnote

Changing Font Size and Style: My Code

Changing Font Size and Style: My Results

HANDS ON: More Font Changes 1.Use the Popup tool to add the code for the column headers (Style Header) to the PROC TEMPLATE code 2.Change the typeface and style to whatever you want 3.Another attribute you can change is FONT_WEIGHT (values: medium or bold) 4.Make further changes to the headers, title, and footnote, if you like 5.Resubmit the program and review your results

More Font Changes: My Code

More Font Changes: My Results

HANDS ON: More Font Changes 1.Use the Popup tool to add the code for the table cells (Style Data) to the PROC TEMPLATE code 2.Change the typeface, weight, and style to whatever you want 3.Make further changes to the headers, title, and footnote, if you like 4.Resubmit the program and review your results

More Font Changes: My Code

More Font Changes: My Results

Changing Rules and Borders Rules are the lines between table cells Borders are the lines around tables, table headers, and table footers Virtually all ODS output is in the form of tables

HANDS ON: Copying a Style 1.Go back to Internet Explorer 2.Hover the mouse over the borders until the table borders turn red 3.Copy the Table style from the popup window

HANDS ON: Pasting the Style 1.Go back to SAS and paste the style into your PROC TEMPLATE 2.Review the RULES= style and FRAME= style attributes

Changing Rules and Borders Lines between cells inside the table are controlled by the Rules style attribute Borders around the outside of the table are controlled by the Frame style attribute

Changing Borders The Frame attribute is currently set to BOX (borders all of the way around the table) Another option is void (no borders) Further options: –above, below, rhs, lhs (pick a side) –vsides, hsides (left and right, top and bottom)

HANDS ON: Changing Borders 1.Change the Frame setting to one of the other options by typing over the word box

Changing Rules The Rules attribute is currently set to groups (lines between table header/footer and body) Other options: –all (lines between all cells) –none (no lines between the table cells) –rows (lines between the rows) –cols (lines between the columns)

HANDS ON: Changing Rules 1.Change the Rules setting to one of the other options by typing over the word groups

Changing Rules and Borders: My Code

Changing Rules and Borders: My Results Wait a minute – didn’t we just set the rules to none? Where did those white lines come from?

Cell Spacing The lines we could see in our table did not come from the table rules They were created because the table background (white) was showing through between the table cells If the CELLSPACING attribute is >0, then the background shows through

HANDS ON: Cell Spacing 1.Go back to the SAS program and change the CELLSPACING setting in the Table style to 0 2.Submit the program

Cell Spacing: My Code

Cell Spacing: My Results

Cell Padding One more attribute is available for tables: CELLPADDING Cell padding puts space inside table cells, between the text and the cell borders Larger values make table more readable Smaller values save space

HANDS ON: Cell Padding 1.Go back to the SAS program and change the CELLPADDING setting in the Table style 2.Submit the program

Cell Spacing: My Code

Cell Padding: My Results

Changing the Color Scheme ODS allows you to specify foreground (text) and background colors Can use color names: red, green, blue Or color hex codes: cxFF0000, cx00FF00, cx0000FF

Changing the Color Scheme *Warning: some color names have typos in SAS, will get warning messages

Changing the Color Scheme To assign a new color: –Pick the correct style element (SystemTitle, SystemFooter, Header, Data) –change the FOREGROUND and BACKGROUND values to the colors you want

HANDS ON: Changing the Colors 1.Go back to the PROC TEMPLATE code 2.In the SystemTitle style, type over the hex code for FOREGROUND with the text “red” (minus the quotes 3.Re-run the program and see what happens

HANDS ON: Changing the Colors

Changing Colors: My Code

Changing Colors: My Results

HANDS ON: Changing More Colors 1.Go back to the PROC TEMPLATE code 2.Change more of the FOREGROUND and BACKGROUND settings 3.Re-run the program and see what happens

HANDS ON: Changing the Colors

Changing Colors: My Code For SystemTitle, SystemFooter, and Header: FOREGROUND = midnightblue BACKGROUND = white For Data and Table: FOREGROUND = black BACKGROUND = white

Changing Colors: My Results Why is the background still gray? We need to add one more style element to our code

HANDS ON: Copy/Paste Code 1.Go back to Internet Explorer 2.Click on the background of the page (hint: look at the parts of your output that still have that gray color, and click on the same area in Internet Explorer) 3.Copy the code from the popup (style Body) and paste it into your PROC TEMPLATE

HANDS ON: Change the Body Colors 1.Edit the colors in the Body style element to your choices 2.Rerun the program

HANDS ON: Changing the Colors

Changing Colors: My Code

Changing Colors: My Results What are those faint gray boxes around the title and footnote?

Removing the Boxes This exposes one limitation to using the popup styles: –You can’t click on these boxes, so there’s no way to find out what code to modify –Solution is in my paper: STYLE SysTitleAndFooterContainer / CELLSPACING=0;

Removing the Boxes: My Results

Changing Colors: More Tips Find a “Color Picker” on the web (Google search on this term) –use the 216-color “web-safe” palette –will help you use hex codes instead of names for more control If you’re not creative, try

RTF differences Instead of Default style as parent, use RTF RTF has very narrow page margins (0.25”). –To change: add style attributes TOPMARGIN, BOTTOMMARGIN, LEFTMARGIN, and RIGHTMARGIN to the Body style element. Set them to a larger value (e.g. 1in). You don’t need to list multiple font names If you are rerunning an ODS RTF program, you need to close the Results window before resubmitting the job Titles and footnotes will appear in the page header and footer, unless you add the option BODYTITLE to your ODS RTF statement Sample Program 5 shows these changes

PDF differences Instead of Default style as parent, use Printer If you get a WARNING message “'Font specification " " failed', you may need to register the fonts on your system. Execute the following code to fix the problem: proc fontreg; fontpath "%sysget(systemroot)\fonts"; run; You don’t need to list multiple font names If you are rerunning an ODS PDF program, you need to close the Results window before resubmitting the job Sample Program 6 shows these changes

Summary You’ve now learned the basics of style modification: fonts, colors, rules/borders, spacing These techniques will allow you customize most aspects of your output You can save your PROC TEMPLATE code, but you don’t need to run it every time (read up on the ODS PATH statement)

Summary Some warnings: –The Popup style is very simple –To modify very specific portions of your output, you will need to add more style elements and settings –RTF and PDF are a little different

References (no need to write down, they’re all in the proceedings) PROC TEMPLATE documentation: –SAS Output Delivery System Users Guide (version online documentation) A CD of additional sample styles: –Bernadette Johnson, Instant ODS: Style Templates for the SAS Output Delivery System, © 2003, BBU Press, Cary, NC, USA. Preliminary documentation of new features and sample programs can be found at: – My book on ODS has a number of chapters on modifying ODS styles: –Haworth, Lauren, Output Delivery System: The Basics,  2001, SAS Institute Inc., Cary, NC, USA.

FINAL HANDS ON: Tweak your Style I’ll be happy to take your questions at this point, or … You can use the remaining time to continue to modify your style Or, you can play with sample programs 5 and 6 THANKS FOR COMING!

COLOR REFERENCE