Download presentation
Presentation is loading. Please wait.
Published byLester Walters Modified over 9 years ago
1
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
3
Goals See useful examples of modifying procedure output See useful examples of modifying procedure output Trigger your thoughts of how it could help you Trigger your thoughts of how it could help you Motivate you to pursue your own study of table templates Motivate you to pursue your own study of table templates
4
My SAS Too much output from Proc Contents Too much output from Proc Contents Proc Freq frequencies don’t use a comma format. Proc Freq frequencies don’t use a comma format. “The FREQ Procedure” on the output. “The FREQ Procedure” on the output.
5
My SAS My Proc Contents My Proc Contents My Proc Freq My Proc Freq My Proc Contents My Proc Contents
6
ODS Basics OutputObject SAS® process or procedure creates one or more output objects. ODS statements route object(s) to destination. Output Object is composed of a data component and for most procedures, a template component.
7
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.
8
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 Table Template Output Object +
9
My Proc Contents
10
List of Variables Only List of Variables Only Remove “The Contents Procedure” Remove “The Contents Procedure”
11
My Proc Freq
12
Frequency is formatted with a comma10. format Percent has a percent (%) sign added Column headings are customized
13
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.
15
My Proc Freq ODS PATH SASUSER.TEMPLAT (UPDATE) SASUSER.TEMPLAT (UPDATE) SASHELP.TMPLMST (READ) SASHELP.TMPLMST (READ) ;
16
My Proc Freq ODS PATH SASUSER.MYTEMPLATES (UPDATE) SASUSER.MYTEMPLATES (UPDATE) SASHELP.TMPLMST (READ) SASHELP.TMPLMST (READ) ;
17
My Proc Freq proc template ; define Base.Freq.OneWayFreqs ; edit Base.Freq.OneWayFreqs ;
18
SASHELP.TMPLMST Base.Contents.Attributes Base.Contents.Variables Base.Freq.OneWayFreqs Etc. SASUSER.MYTEMPLATES My Proc Freq Before Edit
19
SASHELP.TMPLMST Base.Contents.Attributes Base.Contents.Variables Base.Freq.OneWayFreqs Etc. SASUSER.MYTEMPLATES Base.Freq.OneWayFreqs My Proc Freq After Edit
20
For Further Study Base.Freq.OneWayList Base.Freq.List Base.Freq.OneWayFreqs Parent Template Child Templates Base.Freq.Frequency Base.Freq.Percent
21
For Further Study Common.ANOVA.DF SASHELP.TMPLMST Stat.Discrim.DF Stat.Discrim.ANOVA contains DF column Which inherits from parent column Which inherits from grandparent column Stat.GLM.ANOVA contains DF column
22
My Proc Freq Return to Default Behavior? proc template ; delete Base.Freq.OneWayFreqs ; proc template ; delete Base.Freq.OneWayFreqs ; ods path sashelp.tmplmst (read) ; ods path sashelp.tmplmst (read) ;
23
My Proc Contents
24
One Table of Output with: –Selected Attribute and EngineHost Information –Selected Variable Information
26
My Proc Contents 1. 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
27
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
29
Conclusion ODS allows you to add much more customization to your output simply and easily. ODS allows you to add much more customization to your output simply and easily.
30
Acknowledgements Cynthia Zender – SAS Institute
31
Trademark Citation SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries. SAS is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. ® indicates USA registration.
32
Contact Information : Steve James Centers for Disease Control and Prevention MS E-57 Atlanta, Ga. (404) 639-6041 sjames@cdc.gov
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.