|
楼主
楼主 |
发表于 2003-11-13 12:45:29
|
只看该作者
ODS TIPS:如何在报告中根据值的不同动态填色
这段程序可以根据不同数据的MIN,MEAN,MAX进行动态填色,比前面给出的那段要聪明一点
/*Create dataset to play with; */
data ddt;
input x y;
cards;
1 25
2 30
3 40
4 50
5 55
7 60
6 90
;
/*Create format for the colors; */
proc means data=ddt;
var y;
output out=outddt;
run;
data _null_;
set outddt;
if _stat_='MIN' then call symput('MIN1',y);
if _stat_='MEAN' then call symput('MEAN1',y);
if _stat_='MAX' then call symput('MAX1',y);
run;
proc format;
value tlight low-&min1='Blue'
&min1-&mean1='Yellow'
&mean1-<&max1='Green'
&max1-high='Red';
run;
/*Create the report and direct it to html using ODS; */
filename new 'c:\cooltable.html';
ods listing close;
ods html body=new;
proc report data=ddt nowd headline;
column X Y;
define X / display 'x-label' style(column)=[foreground=black background=white];
define Y / analysis 'y-label' style(column)=[foreground=white background=tlight.];
run;
ods html close;
ods listing; |
|