Hello,
I switched to using proc odstext from 'ods rtf text=' statements because the latter did not allow page breaks to work. But proc odstext is giving me some issues with my text justification. Specifically, it will not center-justify text that does not exceed a certain length.
For example, the output of the following is centered:
proc odstext;
p "^S={font_size= 9pt font_style= italic just= c}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx."; run;
But the output of the following stays left-justified:
proc odstext; p "^S={font_size= 9pt font_style= italic just= c}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx."; run;
I have tried to find the exact threshold, but it's a little difficult to tell when the line is exactly the length of the page whether the text is definitely centered or not.
Am I missing something obvious here?
Thanks!
Hi:
Here's the tip sheet:https://support.sas.com/rnd/base/ods/Tipsheet_ListTextBlks.pdf
The techniques shown on the tip sheet worked for me without needing ESCAPECHAR.
Hope this helps,
cynthia
Hi:
Here's the tip sheet:https://support.sas.com/rnd/base/ods/Tipsheet_ListTextBlks.pdf
The techniques shown on the tip sheet worked for me without needing ESCAPECHAR.
Hope this helps,
cynthia
I saw this right after I posted myself, thank you!
Nevermind - turns out you have to include 'just=' separately:
p "^S={font_style= italic just= c}hello"/style=[just=c];
Perhaps you need to look at the examples for Proc ODSTEXT a bit more. For style elements affecting an entire P statement the syntax should look a bit more like:
proc odstext; p "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx." / style=[font_size= 9pt font_style= italic just= c]; run; proc odstext; p "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx." / style=[font_size= 9pt font_style= italic just= c]; run;
Or perhaps:
proc odstext; p "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx." / style=[font_size= 9pt font_style= italic just= c]; p "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx." / style=[font_size= 9pt font_style= italic just= c]; run;
Also which ODS destination are you using? For destinations that will honor the Papersize option that may help.
I note in my html results that resizing the window can make the text appear not centered relative to the other line of text when the window is reduced in width.
I see, thank you!
I am using RTF. Mostly formatting varies within my statements, but I will switch to that when it doesn't.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.