sas ods.rtf输出标题w / in macro

时间:2016-05-30 15:52:07

标签: macros sas output title ods

我无法获得宏的标题,因为由于某种原因,gplot例程生成的标题会覆盖预定义的标题(title1)我缺少什么?

data one;
input state $2. sales @@;
datalines;
VA  5200 
SC  9800 
NC  7500 
GA  12500 
NY  17600
;
run;

goptions reset=all ftext='calibri' htext=2 gunit=pct;
symbol1 i=none f='calibri' v='$' h=4 c=green;
axis1 order=(0 to 20000 by 5000) offset=(0,0) label=none;
axis2 minor=none offset=(3,3) label=none;

* place white space above the title using the LS option;
title1 h=4 'Sales by State --- SAS/Graph-Controlled Order on X-axis' ls=1;

* place white space on left and right of the graph;
title2 a=90 ls=1;
title3 a=-90 ls=1;

footnote1 'BASED ON:  http://support.sas.com/kb/24/916.html' ls=1;
footnote2 ls=1;

%macro gplot2(data);
proc gplot data=&data;
plot sales*state / vaxis=axis1 autovref haxis=axis2;
format sales dollar8.;
run;
quit;
%mend;
OPTIONS nonumber nodate orientation="landscape";
ODS RTF FILE='C:\temp\SAS_output_test.rtf' startpage=no  
    keepn;
ODS RTF NOTOC_DATA;
ODS escapechar='^';
ODS noproctitle;
ODS RTF TEXT='^S={just=left} Dataexport XX-XX-XXXX';
title1 '^S={just=right font=("Arial", 10pt, bold)} test'
   '^S={just=right font=("Arial", 10pt, bold)} Page ^{pageof}';
%gplot2(one);
quit; 
ods rtf close;

页面布局应如下所示:

OPTIONS nonumber nodate orientation="landscape";
ODS RTF FILE='C:\temp\SAS_output_test.rtf' startpage=no  
    keepn;
ODS RTF NOTOC_DATA;
ODS escapechar='^';
ODS noproctitle;
title1 '^S={just=right font=("Arial", 10pt, bold)} test'
   '^S={just=right font=("Arial", 10pt, bold)} Page ^{pageof}';
ODS RTF TEXT='^S={just=left} Dataexport XX-XX-XXXX';
ODS RTF startpage=now; 
ods rtf close;

非常感谢,fleischfressende

0 个答案:

没有答案