1 / 32

My ODS: Real-World Uses of Modifying Table Templates

My ODS: Real-World Uses of Modifying Table Templates . Steve James Centers for Disease Control and Prevention Atlanta, Ga. Goals. See useful examples of modifying procedure output Trigger your thoughts of how it could help you Motivate you to pursue your own study of table templates.

carter
Download Presentation

My ODS: Real-World Uses of Modifying Table Templates

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.

  2. Goals • See useful examples of modifying procedure output • Trigger your thoughts of how it could help you • Motivate you to pursue your own study of table templates

  3. My SAS • Too much output from Proc Contents • Proc Freq frequencies don’t use a comma format. • “The FREQ Procedure” on the output.

  4. My SAS • My Proc Contents • My Proc Freq • My Proc Contents

  5. ODS Basics Output Object SAS® process or procedure creates one or more output objects. Output Object is composed of a data component and for most procedures, a template component. ODS statements route object(s) to destination.

  6. ODS Basics • Some procedures might have only a single output object, whereas others have multiple output objects. • ODS stores a link to each output object in the Results folder, displayed interactively in the Results window. PROC PRINT has one output object. PROC UNIVARIATE has multiple output objects.

  7. ODS Basics An output object is an object that contains both • the results of a Data step or PROC step • information about how to format the results Data Component Output Object + Table Template

  8. My Proc Contents

  9. My Proc Contents • List of Variables Only • Remove “The Contents Procedure”

  10. My Proc Freq

  11. My Proc Freq Frequency is formatted with a comma10. format Percent has a percent (%) sign added Column headings are customized

  12. My Proc Freq Table Template Storage It is a type of SAS file called a template store. SAS Institute provides a template store called TMPLMST in the SASHELP directory.

  13. My Proc Freq ODS PATH SASUSER.TEMPLAT (UPDATE) SASHELP.TMPLMST (READ) ;

  14. My Proc Freq ODS PATH SASUSER.MYTEMPLATES (UPDATE) SASHELP.TMPLMST (READ) ;

  15. My Proc Freq proc template ; define Base.Freq.OneWayFreqs ; <complete definition> edit Base.Freq.OneWayFreqs ; <code for items to change>

  16. My Proc Freq SASUSER.MYTEMPLATES SASHELP.TMPLMST Base.Contents.Attributes Base.Contents.Variables Base.Freq.OneWayFreqs Etc. Before Edit

  17. My Proc Freq SASUSER.MYTEMPLATES SASHELP.TMPLMST Base.Contents.Attributes Base.Contents.Variables Base.Freq.OneWayFreqs Etc. Base.Freq.OneWayFreqs After Edit

  18. For Further Study Base.Freq.OneWayList Base.Freq.Frequency Base.Freq.Percent Parent Template Base.Freq.OneWayFreqs Base.Freq.List Child Templates

  19. For Further Study SASHELP.TMPLMST Stat.Discrim.ANOVA contains DF column Common.ANOVA.DF Stat.Discrim.DF Which inherits from grandparent column Which inherits from parent column Stat.GLM.ANOVA contains DF column

  20. My Proc Freq Return to Default Behavior? • proc template ; delete Base.Freq.OneWayFreqs ; • ods path sashelp.tmplmst (read) ;

  21. My Proc Contents

  22. My Proc Contents One Table of Output with: • Selected Attribute and EngineHost Information • Selected Variable Information

  23. My Proc Contents • Modify existing table template with the changes we want: • Attribute info in the header • Combine type/length and format/informat columns • Engine/Host info in the footer • Use macro variables

  24. My Proc Contents 2. Create a macro that: • Runs Proc Contents, storing output objects as SAS datasets • Reads SAS datasets and store info in macro variables. • Run Proc Contents again using new table template

  25. Conclusion ODS allows you to add much more customization to your output simply and easily.

  26. Acknowledgements Cynthia Zender – SAS Institute

  27. Trademark Citation SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.

  28. Contact Information:Steve JamesCenters for Disease Control and PreventionMS E-57Atlanta, Ga.(404) 639-6041sjames@cdc.gov

More Related