Sample 25411: Demonstrates Customized Templates (I)
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample is from the SAS Sample Library. For additional information refer to "SAS Output Delivery System: User's Guide".
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: ODSTPL1 */
/* TITLE: Demonstrates Customized Templates (I) */
/* PRODUCT: BASE */
/* SYSTEM: ALL */
/* KEYS: ODS HTML PATH TEMPLATE */
/* PROCS: TEMPLATE STANDARD */
/* DATA: */
/* SUPPORT: UPDATE: */
/* REF: */
/* MISC: */
/* */
/****************************************************************/
/* Point ODS in the right direction. */
ods html body = "odstpl1.htm" palette = Default;
ods listing close;
data stan;
do i = 1 to 100;
k = normal(12345);
j = uniform(3579);
jk = j*k;
output;
end;
label k='Some Label'
jk='Longer Label. Longer too.';
run;
/* Proc Standard Output generated using our Default */
/* Template. */
title2 'Have it Our way';
proc standard print mean=75 out=stanout;
run;
data stan;
do i = 1 to 100;
k = normal(12345);
j = uniform(3579);
jk = j*k;
output;
end;
label k='Some Label' jk='Longer Label. Longer too.';
run;
/* Redirect location of template stores so that ODS will */
/* find our Customized Template first. */
ods path work.template(update) sashelp.tmplmst(read);
/* Now lets Customize the Template !!! */
proc template;
define table Base.Standard;
notes "Table definition for PROC Standard.";
/* Changed Order of Columns within Table and Excluded */
/* display of the Label Column. */
column name std mean n;
/* Define a Header that will span across top of entire */
/* table. */
define header h;
text "Weekly Report";
style = HeaderEmphasis;
end;
/* Changed Column Header for Mean to Average and */
/* changed its Format and Column Style. */
define mean; header="Average" format=8.2;
style = DataStrong; end;
define name; header="Name"; end;
/* Changed Column Format for STD column. */
define std; header="/Standard/Deviation" format=8.2; end;
define n; header="N" format=best.; end;
common: byline wrap;
/* Define a Footer that will span across bottom of */
/* entire table. */
define footer f;
text "For Week of April 10th";
style = FooterEmphasis;
end;
end;
run;
title2 'Or..... Have it YOUR way!!!!';
proc standard print mean=75 out=stanout;
run;
/* Remove the Customized Template for Proc Standard. */
proc template;
delete Base.Standard;
run;
/* Redirect Template path back to Default. */
ods path sashelp.tmplmst(read);
/* All done, let us take a look. */
ods html close;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Create a customized table template for PROC STANDARD.
| Type: | Sample |
| Topic: | Third Party ==> Output ==> HTML SAS Reference ==> Procedures ==> TEMPLATE SAS Reference ==> ODS (Output Delivery System)
|
| Date Modified: | 2005-10-26 03:03:04 |
| Date Created: | 2005-05-23 13:52:00 |
Operating System and Release Information
| SAS System | Base SAS | All | 8 TS M0 | n/a |