My students are using SAS OnDemand for Academics, SAS Studio,
I want to use bodytitle for RTF.
I tried,
ods rtf(web) bodytitle;
and I get the errors below. I have tried, running ods rtf close first and I still get the same results. Any ideas? Is it just not possible?
Hi:
This works for me -- using the full control method with FILE= in SAS OnDemand for Academics:
Here's the code to test -- you will need to make an all_output folder under your main Files (Home) top node.
ods rtf file='~/all_output/trybodytitle.rtf' bodytitle;
title 'Twas Brillig and the Slithy Toves';
proc print data=sashelp.class;
run;
ods rtf close;
The ~ (tilde) is a place holder for your /home folder name. This is /home/<yourUserID> -- but you have to know what your userID is or do a right-click on Files(Home) and choose Properties to find what the path is.
Hope this helps,
Cynthia
@LauraRK wrote:
My students are using SAS OnDemand for Academics, SAS Studio,
I want to use bodytitle for RTF.
I tried,
ods rtf(web) bodytitle;
and I get the errors below. I have tried, running ods rtf close first and I still get the same results. Any ideas? Is it just not possible?
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;NOTE: ODS statements in the SAS Studio environment may disable some output features.737475 ods rtf(web) bodytitle;WARNING: BODYTITLE and BODYTITLE_AUX cannot be changed in mid document.
The message says that you already set the Body_title, or the default and as the message says SAS will not change the behavior in the middle of a document. You have to set the property in the first ODS RTF statement and that is the option applied to the entire document.
If want to mix titles in the header and the body of the document you will have to use a different approach to add text in the body such as using ODS Text or Proc Odstext instead of Title statements.
Hi:
This works for me -- using the full control method with FILE= in SAS OnDemand for Academics:
Here's the code to test -- you will need to make an all_output folder under your main Files (Home) top node.
ods rtf file='~/all_output/trybodytitle.rtf' bodytitle;
title 'Twas Brillig and the Slithy Toves';
proc print data=sashelp.class;
run;
ods rtf close;
The ~ (tilde) is a place holder for your /home folder name. This is /home/<yourUserID> -- but you have to know what your userID is or do a right-click on Files(Home) and choose Properties to find what the path is.
Hope this helps,
Cynthia
Interestingly enough. The original RTF destination inserts the title into the header of the document and the footnote into the footer of the document, by design. The developers for the original RTF felt that SAS TITLE and FOOTNOTE statement belonged up there, along with the page numbers. I guess (this is MY theory) that because the SAS page number went on the same line as title1, and since Word puts page numbers in the header, that's where the whole TITLE as HEADER etc came from originally.
BODYTITLE was NOT one of the original RTF options for creating output. It was people who needed to combine RTF documents were not thrilled with manually moving the SAS titles out of the document headers so they could put the new, combined document info up in the document header and they wanted the SAS TITLE to be inside the body of the document. That's when BODYTITLE as an option was implemented. I know... fascinating, right ... old ODS history.
For a really nice crisp "no interior lines" output the developers have come up with the JOURNAL style, which I really like. However, the gray headers and interior table lines (the RTF default style) are very popular as beginner style. However, it is SOOO easy to change those if you are using PROC PRINT, PROC REPORT or PROC TABULATE. My personal fav is to do this (since when I teach, I most always wear something purple:
ods rtf file='~/all_output/trybodytitle.rtf' bodytitle;
title c=purple 'Twas Brillig and the Slithy Toves';
proc print data=sashelp.class
style(header)={background=white color=purple font_style=bold}
style(obsheader)={background=white color=purple font_style=bold}
style(obs)={background=white color=purple font_style=bold};
run;
ods rtf close;
ods rtf file='~/all_output/trybodytitle2.rtf' bodytitle style=journal;
title c=purple 'Twas Brillig and the Slithy Toves';
proc print data=sashelp.class
style(header)={background=white color=purple font_style=bold}
style(obsheader)={background=white color=purple font_style=bold}
style(obs)={background=white color=purple font_style=bold};
run;
ods rtf close;
Cynthia
Thank you Cynthia. I do think the history is interesting. I started using SAS before there was ODS (I believe version 6.2 or something, back in 1992 on unix) and remember being excited when I could even get RTF output and when I first used PROC MIXED with ods tables and was able to take charge of my output. I would have disagreed with the original developers but I think it is because I am always trying to fit a lot of output in a small space and due to wanting to always save toner and resources back when we used to print things. I too like the journal styles and really am glad they now have one with arial font. If I was master of the world it would be bodytitle, no new page, a journal or pearl style.
In case anyone googles this,
I also like using macro variables to make pretend titles, this is especially nice for pdf, but I probably could also use it with RTF as well.
ods pdf file="&folder\solutions.pdf" startpage=no style=pearl;
ods escapechar='^';
*Setting up the title macro variable;
%let liketitle=^S={font=('Arial',11pt,bold) just=center};
ods text= "&liketitle Problem 2 Data Sample ^n ^n"; /*the ^n leaves some black space*/
proc print data=sashelp.cars;
run;
ods pdf close;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: