I know that ODS EXCEL does not do preimage and postimage in titles and footnotes, and suspect that ODS WORD may be the same. Can anyone confirm and suggest a work around that isn't a Unicode font? TIA.
/*You could use "proc odstext" instead of TITLE statement*/
options validvarname=any validmemname=extend nodate nonumber leftmargin=1.91cm rightmargin=1.91cm topmargin=2.54cm bottommargin=2.54cm ;
data 签署知情同意书;
infile cards truncover;
input a :$30. b $200.;
cards;
签署知情同意书 .
签署知情同意书日期 ~{style [FONTFAMILY='Times New Roman Uni']|__|__|__|__|}年~{style [FONTFAMILY='Times New Roman Uni']|__|__|}月~{style [FONTFAMILY='Times New Roman Uni']|__|__|}日
;
ods path work.template(update) sashelp.tmplmst;
proc template;
define style styles._journal;
parent=styles.word;
class table / margintop=20 rules=all frame=box NOBREAKSPACE=OFF outputwidth=100% cellpadding=10 cellspacing=0 FONTFAMILY='宋体' just=l; /*cellpadding=0 cellspacing=0*/
style header from header / background=black;
end;
run;
title;
ods escapechar='~';
ods _all_ close;
ods word file="c:\temp\want.docx" style=_journal startpage=no;
proc odstext PAGEBREAK= No contents="" ;
h2 "签署知情同意书" / style={just=l color=black fontweight=bold FONTFAMILY='宋体' fontsize=0.50cm preimage='c:\temp\sas.png' }; /*<----*/
run ;
data _null_;
set 签署知情同意书 end=last;
if _N_ = 1 then do;
dcl odsout obj();
obj.table_start();
end;
** row for every obs;
obj.row_start();
if _n_=1 then obj.format_cell(data: a,column_span:2, style_attr:"fontweight=bold FONTFAMILY='宋体' fontsize=0.50cm background=graybb just=l" );
else do;
obj.format_cell(data: a, column_span:1, style_attr:"FONTFAMILY='宋体' fontsize=0.38cm vjust=m just=l ");
obj.format_cell(data: b, column_span:1, style_attr:"FONTFAMILY='宋体' fontsize=0.38cm vjust=m just=l ");
end;
obj.row_end();
if last then do;
obj.table_end();
end;
run;
ods word close;
Hi:
Do you mean BODYTITLE vs EMBEDDED_TITLES? I think the EMBEDDED_TITLES is unique to ODS EXCEL. ODS RTF has the BODYTITLE option and ODS WORK has the sub-option BODY_TITLE='ON'.
Cynthia
/*You could use "proc odstext" instead of TITLE statement*/
options validvarname=any validmemname=extend nodate nonumber leftmargin=1.91cm rightmargin=1.91cm topmargin=2.54cm bottommargin=2.54cm ;
data 签署知情同意书;
infile cards truncover;
input a :$30. b $200.;
cards;
签署知情同意书 .
签署知情同意书日期 ~{style [FONTFAMILY='Times New Roman Uni']|__|__|__|__|}年~{style [FONTFAMILY='Times New Roman Uni']|__|__|}月~{style [FONTFAMILY='Times New Roman Uni']|__|__|}日
;
ods path work.template(update) sashelp.tmplmst;
proc template;
define style styles._journal;
parent=styles.word;
class table / margintop=20 rules=all frame=box NOBREAKSPACE=OFF outputwidth=100% cellpadding=10 cellspacing=0 FONTFAMILY='宋体' just=l; /*cellpadding=0 cellspacing=0*/
style header from header / background=black;
end;
run;
title;
ods escapechar='~';
ods _all_ close;
ods word file="c:\temp\want.docx" style=_journal startpage=no;
proc odstext PAGEBREAK= No contents="" ;
h2 "签署知情同意书" / style={just=l color=black fontweight=bold FONTFAMILY='宋体' fontsize=0.50cm preimage='c:\temp\sas.png' }; /*<----*/
run ;
data _null_;
set 签署知情同意书 end=last;
if _N_ = 1 then do;
dcl odsout obj();
obj.table_start();
end;
** row for every obs;
obj.row_start();
if _n_=1 then obj.format_cell(data: a,column_span:2, style_attr:"fontweight=bold FONTFAMILY='宋体' fontsize=0.50cm background=graybb just=l" );
else do;
obj.format_cell(data: a, column_span:1, style_attr:"FONTFAMILY='宋体' fontsize=0.38cm vjust=m just=l ");
obj.format_cell(data: b, column_span:1, style_attr:"FONTFAMILY='宋体' fontsize=0.38cm vjust=m just=l ");
end;
obj.row_end();
if last then do;
obj.table_end();
end;
run;
ods word close;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.