BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

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 .

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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;
--
Paige Miller

View solution in original post

4 REPLIES 4
ballardw
Super User

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.

PaigeMiller
Diamond | Level 26

@ballardw can you give an example of using PROC ODSTEXT in this simple case?

--
Paige Miller
ballardw
Super User

@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.

PaigeMiller
Diamond | Level 26

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;
--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 4257 views
  • 1 like
  • 2 in conversation