ODS Layout Introduction
Transcription
ODS Layout Introduction
Liying (Lily) Wu Research analyst Health Quality Council (Saskatchewan) 1. Basics of ODS layout 2. ODS layout application ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ Page plan Page setting Layout region Text Graphics Table Image Border 1.1 What is ODS layout ? Arrangement of text, tables and graphics on the same page in a way you like. Example report 1.2 ODS layout modes Absolute Layout ◦ In this mode, you specify the exact position of each region within the layout. Gridded layout Gridded layout essentially acts like a table with each "cell” containing the output (usually) from a single procedure. SAS code: Columns=2 Colum_gutter= 0.5 in Column_widths=4.5in Rows=2 Row_gutter=0.3in Row_Heights=4in 1.3 SAS facility Involved ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ODS features In-line formatting Proc template Proc report Proc tabulate Proc gplot Proc sgplot Proc print Proc freq Proc gslide ……. 1.4 Limitation a. Limited destination b. Repeat image inserting c. Image size d. Different orientation in multipage 2.1 Page plan ◦ 1. Report pages ◦ 2. Page setting ◦ 3. Layout (header, footnote, footer, text, pictures, table…..) ◦ 4.Layout mode 2.2 Page setting (Layout container and margin) 1. 0 in 8.5 in ODS listing close; Option orientation=portrait papersize=letter topmargin=0.001in bottommargin=0.001in leftmargin=0.001in rightmargin=0.001in; 2. ODS layout start width=8.5in height=11in; 11 in 2.3 Report page Single page ODS pdf file=‘S: \liying\ACSC\mock_up.pdf’ style=sty1 ; ODS layout start width=8.5in height=11in; ..insert code here... ODS layout end; ODS pdf close; Multiple page ODS pdf file=‘S: \ liying\ACSC\mock_up.pdf’ style=sty1 ODS layout start width=8.5in height=11in; ..insert code here... ODS layout end; ODS layout start width=8.5in height=11in; ..insert code here... ODS layout end; ODS pdf close; ; 2.4 Layout region The ODS LAYOUT and REGION statements allow many options that provide control over placement of content. Options that can be used on the ODS REGION statement include: • X= – Relative to left side of LAYOUT space (absolute ). • Y= – Relative to upper side of LAYOUT space (absolute ). • WIDTH= – Width of the REGION (absolute, gridded). • HEIGHT = – Height of the REGION (absolute, gridded). • COLUMN= – Column where the REGION should be placed (gridded only). • ROW= – Row where the REGION should be placed (gridded only). 2.4 Layout region (Con’t) SAS code: ODS REGION x=1in y=0.11in width=6.6in height=0.4in; 2.5 Text ODS REGION x=1in y=0.25in width=6.6in height=0.4in; ODS PDF text="^S={font_face=arial font_size=12pt font_weight=bold just=center}Rate of Congestive Heart Failure related hospitalizations per 100,000 population aged <75 for all Saskatchewan"; 2.6 Graphics ODS region x=0.001in y=1in width=11.5in height=8.5in ; ODS GRAPHICS/noborder; ODS REGION x=0.001in y=1in width=11.5in height=8.5in; proc sgplot data=grap.mock1; yaxis label=" Rate per 100,000" grid values=(0 to 150 by 10); xaxis display=(nolabel) discreteorder=data ; series x=time y=SK_hosp /markers markerattrs=(size=8 symbol=circlefilled color=CX13478C) datalabel lineattrs=(thickness=3 color=CX4D7EBF); series x=time y=SK_incid /markers markerattrs=(size=8 symbol=circlefilled color=CXE0A860) datalabel lineattrs=(thickness=3 color=CXE0A860 pattern=solid); series x=time y=SK_pre /markers markerattrs=(size=8 symbol=circlefilled color=CX2A8307) datalabel lineattrs=(thickness=3 color=CX2A8307 pattern=solid); Run; 2.7 Table ODS region x=0.15in y=6.8in width=10in height=3in ; Proc report data=Grap.mock3 nowd; define time / "Time"; run; 2.8 Image ODS REGION x=5.66in y=9.7in width=5in height=3in; ODS PDF text="^S={preimage='/SAS_data/dw0/HQC_share/Lily/ACSC/picture/pu tting patients first11.jpg'}"; 2.9 Border ODS region x=0.02in y=0.65in width=2.8in height=2.19in ; goptions reset=all; proc gslide cframe=black wframe=2; run; quit; 1. Brian T. Schellenberger “ODS LAYOUT: Arranging ODS Output as You See Fit.”Available at http://www2.sas.com/proceedings/sugi28/148-28.pdf. 2. O’Conner, Daniel and Huntley, Scott (2009). “Breaking New Ground with SAS 9.2 ODS Layout Enhancements.” Proceedings of the 2009 SAS Global Forum Conference. Available at http://support.sas.com/resources/papers/proceedings09/043-2009.pdf. 3. Mays, Rich (2007). “ODS LAYOUT is Like an Onion.” Proceedings of SUGI 31. Available at http://www2.sas.com/proceedings/sugi31/15931.pdf. 4. Gina Huff (2011) “Absolutely Fabulous: Tips on Creating a PublicationReady Report using ODS Absolute Layout Functionality.” Proceedings of the 2011 SAS Global Forum Conference. Available at http://support.sas.com/resources/papers/proceedings11/293-2011.pdf. 5. O’Conner, Daniel and Huntley, Scott (2008). “Custom Reporting Using ODS Layout.” Power Point Slides. Available at http://support.sas.com/rnd/base/early-access/index.html. Thank you !