- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Trying out ODS Word. I realize it is pre-production. Perhaps I am just writing something wrong. I have 3 different proc prints/ODSTEXT statements each with a unique title. However, I only see the first title showing in the created Word file although in the listing i do see the correct titles. I did turn startpage off to all be on 1 page and when i toggle that back to yes, I do see all 3 titles. Please help me understand why setting startpage=no does not allow me to have separate titles.
ods word file='h:\testing.docx' sasdate options(body_title='yes' toc_data='on') nogtitle startpage=no;
proc print data=fun; title 'Does it print'; run;
proc print data=fun; title '2nd title'; run;
proc print data=fun; title '3rd title'; run;
ods word close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Did you try the option as "bodytitle" instead of "body_title"?
If you don't have any graphic output I might suggest removing the NOGTITLE as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
Except for misspelling 3rd as 3nd, I can get close to what you want with ODS TEXT:
Or using PROC REPORT and a COMPUTE block:
Hope this helps,
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Does it print
Obs
a
1 1
2 2
3 3
Obs
a
1 1
2 2
3 3
Obs
a
1 1
2 2
3 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I can't run your code since I don't have your data. However, when I run the code that I posted, I get the results shown in my screen shots. Here's my code using SASHELP data so anyone can run it.
** Example 1;
ods word file='c:\temp\testings.docx' sasdate nogtitle startpage=no
options(bodytitle='yes' toc_data='on');
proc print data=sashelp.class(obs=3);
title 'Does it print at top of page';
run;
ods text="2nd title (pseudo title with ODS TEXT)";
proc print data=sashelp.shoes(obs=2); run;
ods text="3rd title (pseudo title with ODS TEXT)";
proc print data=sashelp.classfit(obs=3); run;
ods word close;
** Example 2;
ods word file='c:\temp\report_example.docx' sasdate nogtitle startpage=no
options(bodytitle='yes' toc_data='on');
proc report data=sashelp.class(obs=3);
title 'Does it print at top of page';
run;
proc report data=sashelp.shoes(obs=2);
compute before _page_ / style=SystemTitle;
line "2nd title (pseudo title with PROC REPORT)";
endcomp;
run;
options nolabel;
proc report data=sashelp.classfit(obs=3);
compute before _page_ / style=SystemTitle;
line "3rd title (pseudo title with PROC REPORT)";
endcomp;
run;
ods word close;
If my code doesn't work for you as shown in my screen shots using SASHELP data, then my suggestion is that you open a track with Tech Support. Just because BODYTITLE with ODS RTF works as you want does not mean that the option will work the same way in ODS WORD:
Perhaps this is something (making BODYTITLE work the same in ODS WORD) is something that is on the drawing board. Perhaps this is something that they can't do in ODS WORD. If you want the ODS RTF behavior with BODYTITLE, then use ODS RTF. If you want to use ODS WORD, then there are 2 workarounds with ODS WORD - -either ODS TEXT or using PROC REPORT with a COMPUTE block. For more in-depth help on BODYTITLE and ODS WORD, if neither of these options will work for you and if using ODS RTF doesn't work, then you'll need to work with Tech Support on this question.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Cynthia. I will do that.