Example:
ods excel file="example.xlsx" options(sheet_interval='NONE');
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
ods text='Additional Information Goes Here';
ods excel close;
This works as expected, placing the text under the plot. But suppose I want the ODS TEXT to be a different font, or a different size, or a different color? How can I do this? I'm guessing PROC TEMPLATE gets it done, but I really have no idea how .
Never mind ... I think I figured it out
ods excel file="example.xlsx" options(sheet_interval='NONE');
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
ods escapechar='^';
ods text='^{style [color=red]Additional Information Goes Here}';
ods excel close;
Escapechar plus some style overrides may work but I've pretty much moved to Proc ODSTEXT for most of the things I used to (try) to do with ODS Text.
@ballardw can you give an example of using PROC ODSTEXT in this simple case?
@PaigeMiller wrote:
@ballardw can you give an example of using PROC ODSTEXT in this simple case?
Proc odstext; p "Simple default text"; p "Some text to make bold"/style={fontweight=bold}; p "Text to make red" /style = {color=red}; run;
Major differences with Proc ODSTEXT and the cousing ODSLIST is that the input can be stored in a data set. The properties are basically per paragraph (the P at the start). A simple p; is blank paragraph.
One reason I use Odstext is that in some cases if there is not other ods output generated following then the ODS text did not appear in the out document, so didn't do well as a footnote substitute.
Never mind ... I think I figured it out
ods excel file="example.xlsx" options(sheet_interval='NONE');
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
ods escapechar='^';
ods text='^{style [color=red]Additional Information Goes Here}';
ods excel close;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.