Programs That Illustrate Inheritance
Overview
The programs in this section show the PROC TEMPLATE steps that were used in
“Understanding Styles, Style Elements, and Style Attributes” in Chapter 14 of SAS 9.4
Output Delivery System: Procedures Guide to illustrate inheritance in style templates.
These programs also show the SAS code that uses the style definitions.
Using the FROM option
This program generates the HTML output in the section “Using the FROM Option” in
Chapter 14 of SAS 9.4 Output Delivery System: Procedures Guide.
This version of the code uses the FROM option in the STYLE statement to create the
Colors style element in the Concepts.Style2 style template.
ods path sashelp.tmplmst(read) sasuser.templat(update);
title;
options nodate pageno=1 linesize=72 pagesize=60;
data test;
input country $ 1-13 grain $ 15-18 kilotons;
datalines;
Brazil Rice 10035
China Rice 190100
India Rice 120012
Indonesia Rice 51165
United States Rice 7771
;
proc template;
define table mytable;
column x y z w;
define x;
style=celldatasimple;
dataname=country;
header='Country';
end;
define y;
style=celldataemphasis;
dataname=grain;
header='Grain';
end;
define z;
style=celldatalarge;
dataname=kilotons;
header='Kilotons';
end;
define w;
style=celldatasmall;
dataname=kilotons;
header='Kilotons';
Programs That Illustrate Inheritance 1081

Get SAS 9.4 Output Delivery System, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.