Working with ODS LAYOUT

ODS LAYOUT statements enable you to create custom reports that easily mix SAS graphics, images, text, and tables, and then arrange them on a page where you like.
  • The ODS LAYOUT GRIDDED statement enables you to format in a gridded layout. The ODS LAYOUT GRIDDED statement follows the traditional ODS statement usage in which you wrap (sandwich) your procedure code with a definitive starting and ending location. ODS layout is designed to allow nested layouts (containers) to provide endless customization.
  • The ODS LAYOUT ABSOLUTE statement enables you to specify the exact location on the page to place a layout and region container. Each container needs to be explicitly placed to ensure that there is no unintended overlap. The ODS LAYOUT ABSOLUTE statement follows the traditional ODS statement usage in which you wrap (sandwich) your procedure code with a definitive starting and ending location. ODS layout is designed to allow nested layouts (containers) to provide endless customization.
For complete documentation about ODS LAYOUT statements, see Arranging Output with ODS LAYOUT in SAS Output Delivery System: User’s Guide.
The following example uses the ODS LAYOUT ABSOLUTE statement and the ODS REGION statement for an absolute layout. This example mixes graphics, images, text, and tables.
options nodate nonumber;

proc template;
   define style Styles.OrionCalloutBlock;
   parent=Styles.Pearl;
   style LayoutRegion/ background=cxbbb2e0;
end;
run;

ods escapechar="~";
title "~{style [preimage='c:\Public\orionstarHeader.jpg' width=100pct 
       background=cx494068 color=cxbbb2e0 font_size=32pt] Our Company }";

footnote "~{style [font_size=10pt just=right color=cxbbb2e0]
       Using ODS Absolute Layout Features.}";

ods pdf file="OrionstarCoInfo.pdf" notoc nogtitle nogfootnote;

ods layout absolute;

ods text="~{style [preimage='c:\Public\starLarge.gif' 
       font_style=italic font_size=20pt color=cxbbb2e0]Who we are...}";

ods region y=0.5in x=1in width=6in;
ods text="The Orion Star Sports & Outdoors Company is a fictional 
       international retail company that sells sports and outdoor products. 
       The headquarters is based in the United States. Retail stores are 
       situated in a number of other countries including Belgium, Holland, 
       Germany, the United Kingdom, Denmark, France, Italy, Spain, and
       Australia.";

ods region y=1.25in x=1in width=4in;
ods text="Products are sold in physical retail stores, by mail order 
       catalogs, and through the Internet. Customers who sign up as members
       of the Orion Star Club organization can receive favorable special 
       offers; therefore, most customers enroll in the Orion Star Club. The 
       sales data in this scenario includes only the purchases of Orion 
       Star Club members from 1998 through 2002.";

ods region y=2.5in height=1in width=3in;
ods text="~{style [preimage='c:\Public\starLarge.gif' font_style=italic 
       font_size=20pt color=cxbbb2e0]What we sell...}";

ods region y=3in x=1in width=4in height=1.75in;
ods text="Approximately 5500 different sports and outdoor products
       are offered at Orion Star. Products are sold in volumes that reflect
       the different types of sports and outdoor activities that are performed
       in each country. Therefore, some products are not sold in certain 
       countries. All of the product names are fictitious.";
ods text="~{newline}Products are organized in a hierarchy 
       consisting of three levels:";
ods text="Product Line";
ods text="Product Category";
ods text="Product Group";

ods region y=4.75in height=1in width=5in;
ods text="~{style [preimage='c:\Public\starLarge.gif' 
       font_style=italic font_size=20pt color=cxbbb2e0]
       Where we generate our profit...}";

ods region y=5.35in width=4.75in height=3.75in;
goptions device=png htext=.1in; 
proc gchart data=sashelp.orsales; 
   pie product_category / sumvar=profit
                          value=none
                          percent=outside 
                          slice=outside;
run;
quit;

ods region y=5.5in x=4.625in width=3in height=3.7in;
proc report nowd data=sashelp.orsales 
       style(header)={background=cx494068 color=cxbbb2e0};
       columns product_category profit;
       define product_category / group;
       define profit /analysis sum format=dollar14.;
run;
 
ods pdf style=Styles.OrionCalloutBlock;

ods region x=6in y=1.0625in width=2in height=1in;
ods text="~{style [background=cx494068 color=cxbbb2e0 
       font_size=24pt just=center font_style=italic width=100pct]
       Our Mission }";
ods text="~{style [font_style=italic vjust=center font_size=10pt 
       just=center]To deliver the best quality sporting equipment, 
       accessories, and outdoor equipment for all seasons at the
       most affordable prices.}";

ods region x=6in y=2.1875in width=2in height=1in;
ods text="~{style [background=cx494068 color=cxbbb2e0 
       font_size=24pt just=center font_style=italic width=100pct]
       Our Vision }";
ods text="~{style [font_style=italic vjust=center font_size=10pt 
       just=center]To transform the way the world purchases sporting 
       and outdoor equipment.}";

ods region x=6in y=3.3125in width=2in height=1in;
ods text="~{style [background=cx494068 color=cxbbb2e0 
       font_size=24pt just=center font_style=italic width=100pct]
       Our Values }";
ods text="~{style [font_style=italic vjust=center 
       font_size=10pt just=center]To stay Customer focused, Swift 
       and Agile, Innovative, and Trustworthy.}";

ods region x=6in y=4.4375in width=2in height=1in;
ods text="~{style [background=cx494068 color=cxbbb2e0 
       font_size=24pt just=center font_style=italic width=100pct]
       Our Goal }";
ods text="~{style [font_style=italic vjust=center font_size=10pt 
       just=center]To grow sales by 15% annually while improving 
       profit margins through innovative thinking and operational 
       efficiencies.}";

ods layout end;
ods pdf close; 
ODS Absolute Layout – Company Information
ODS Absolute Layout – Company Information