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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.