Previous Page | Next Page

TEMPLATE Procedure: Creating Tabular Output

Example 1: Editing a Table Template That a SAS Procedure Uses


PROC TEMPLATE features:

EDIT statement

Header attributes:

JUST=

STYLE=

Table attributes:

DOUBLE_SPACE=

OVERLINE=

UNDERLINE=

Other ODS features:

ODS HTML statement

ODS SELECT statement

Data set: Exprev.


Program Description

Note:   This example uses filenames that might not be valid in all operating environments. To successfully run the example in your operating environment, you might need to change the file specifications. See ODS HTML Statements for Running Examples in Different Operating Environments.  [cautionend]

This example customizes the table template for the Moments output object from PROC UNIVARIATE. The first program uses the table template that SAS supplies to generate both listing output and HTML output of the Moments object.

The second program does the following:


Program 1: Using the Default Table Template That SAS Provides

 Note about code
options nodate pageno=1 pagesize=60 linesize=72;
 Note about code
ods html body="DefaultMoments-Body.htm ";
 Note about code
ods select moments;
 Note about code
proc univariate data=exprev mu0=3.5;
   var Quantity;
title "Default Moments Table";
run;
 Note about code
 ods html close;

Default Listing Output

Listing Output from PROC UNIVARIATE (Default Moments Table)

[Listing Output from PROC UNIVARIATE (Default Moments Table)]


HTML Output from PROC UNIVARIATE (Default Moments Table)

Default HTML Output

[Default HTML Output]


Program 2: Using a Customized Table Template

 Note about code
ods path sasuser.templat(update) sashelp.tmplmst(read);
 Note about code
proc template;
   edit base.univariate.moments;
 Note about code
   double_space=on;  
   underline=on;  
   overline=on; 
 Note about code
      edit head;
 Note about code
         style=header{color=green fontstyle=italic};
 Note about code
         just=left;
 Note about code
     end;
   end;
run;
 Note about code
ods html body="Custommoments-Body.htm";
 Note about code
ods select moments;
 Note about code
proc univariate data=exprev mu0=3.5;
   var Quantity;
title "Custom Moments Table";
run;
 Note about code
ods html close;

Customized Listing Output

Listing Output (Customized Moments Table) from PROC UNIVARIATE

[Listing Output (Customized Moments Table) from PROC UNIVARIATE]


Customized HTML Output

Customized HTML Output (Customized Moments Table) from PROC UNIVARIATE (Viewed with Microsoft Internet Explorer)

[Customized HTML Output (Customized Moments Table) from PROC UNIVARIATE (Viewed with Microsoft Internet Explorer)]

Previous Page | Next Page | Top of Page