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

I am preparing a figure and it has title.  I do not want to use TITLE statement, because I do not want the text and figure merged together.

So I used ods text to output text, like below.  I want "company name" is at left,  "study" is at center and "Protocol" is at right. However the text can not be adjusted properly.

If I used TITLE statement,  the text  could be very easily adjusted.

Can someone help me out? Eigher to adjust the text with ods text, or to use title but to separate the text and figure. Thanks in advance.

 

ods text="^S={just=l}company name ^S={just=c}study ^S={just=r} Protocol";

title j=l "Company name" j=c "Study" j=r "Protocol";

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

You need NOGTITLE option.

 

ods tagsets.rtf file='c:\temp\temp.rtf' nogtitle   style=journal ;
proc sgplot data=sashelp.class;
title j=l "Company name" j=c "Study" j=r "Protocol";
   scatter y=height x=weight / group=sex;
   xaxis label= "Females are second in the data  set and legend.";
run;
ods tagsets.rtf close;

View solution in original post

5 REPLIES 5
Niugg2010
Obsidian | Level 7
I forgot to mention that I outputted the figure and text in rtf file.
ballardw
Super User

ODS Text is not very bright and you have to take control of a great many things. You might try setting the WIDTH of the output to 100% of the page width. Without a known width the Ods Text processor doesn't understand that you want to use the whole width of the page. I don't have access to code currently where I have done this in the past but I think I used something like Width=8in in the first of the Style options. 8in = 8 inches, and should match your margin settings. You need to make sure it affects the whole string, use (), otherwise the first value may get the entire width.

 

I suspect that you are currently getting the 3 items with basically just a space between them if I remember correctly from working through this a while ago.

Niugg2010
Obsidian | Level 7
Ballardw, I tried to set width in style, it does not work. Anyway, Thank you for your help.
Ksharp
Super User

You need NOGTITLE option.

 

ods tagsets.rtf file='c:\temp\temp.rtf' nogtitle   style=journal ;
proc sgplot data=sashelp.class;
title j=l "Company name" j=c "Study" j=r "Protocol";
   scatter y=height x=weight / group=sex;
   xaxis label= "Females are second in the data  set and legend.";
run;
ods tagsets.rtf close;
Niugg2010
Obsidian | Level 7
Ksharp, Thank you very much. It works, not only for ods tagsets.rtf, also it works for ods rtf.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 1717 views
  • 0 likes
  • 3 in conversation