Usage Note 23661: Can I use the DATA step with ODS?
There are two different ways to use the DATA step with ODS.
The first way is to bind a template with a table to generate
the output of the data set with the formatting instructions of
the table template. This can also be done without
binding a table.
proc template;
define table test;
define column col;
generic;
end;
define column col1;
generic;
end;
define column char_var;
generic;
justify=on;
end;
end;
run;
ods html body='temp.html';
data _null_;
set sashelp.class;
file print ods=(template='test'
columns=(
col=age(generic=on)
col1=height(generic=on)
col1=weight(generic=on)
char_var=name(generic=on)
char_var=sex(generic=on)
));
put _ods_;
run;
ods html close;
The second method is to use a DATA _NULL_ with PUT statements
for printing. This method uses
batch mode to store the tables and
is similar to the output that you get from PROC COMPARE,
PROC CHART, PROC PLOT, and PROC TIMEPLOT. This method is not
fully integrated into ODS because ODS does not
keep up with the PUT statements.
Currently, the output is just enclosed in
<pre> and </pre> HTML tags.
This will change in the
future.
To apply a style to the output created with this method,
use the Style element Batch.
Below is an example that modifies the
font size and font face properties.
proc template;
define style styles.test;
parent=styles.default;
style batch from batch /
font_size=10
font_face=courier;
end;
run;
ods html body='temp.html' style=styles.test;
data _null_;
set sashelp.class;
file print;
put 'this age is' age;
run;
ods html close;
For more information about using the DATA step with ODS, see the
paper ODS: The DATA Step Knows
(.pdf).
See also the full PROC TEMPLATE FAQ and Concepts.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> ODS (Output Delivery System) SAS Reference ==> DATA Step
|
Date Modified: | 2005-07-21 16:54:56 |
Date Created: | 2004-01-09 16:24:52 |