DATA Step, Macro, Functions and more

title is not working with SAS EG 5.1 using ods tagsets.rtf

Reply
Contributor
Posts: 43

title is not working with SAS EG 5.1 using ods tagsets.rtf

Hello, I am using a proc format because most of my text is left justify but I would like to use the title option or any other option that will works with SAS EG 5.1 and that will permits me to put some line of text justify = center as below

 

This is my first line of text

This is my second line of text

 

                                    This is my first title

 

This is my third line of text.

 

You will find my code below.  The title option is not recognized at all.  Any suggestion?

 

ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);

ODS _ALL_ CLOSE;

proc template;

define style Styles.UserText;

parent = Styles.Default;

CLASS UserText from SystemTitle /

just=Left

FONT_FACE = "Arial, Helvetica, sans-serif"

fontstyle=roman

fontsize=12pt

fontweight=bold

color=black;

end;

run;

ods escapechar='^';

ods tagsets.rtf file='\\AHOMEDIRPNAS\Homedirp\ALE252\Travail\Temp2\test4.rtf' startpage=no style=Styles.UserText options (Tables_OFF='usertext');

ods tagsets.rtf text='this is a text line';

ods tagsets.rtf text="^{style[ color = red font_size=14pt font_style=italic] This is a second line of text}";

ods tagsets.rtf text="^{style[ just=c color= blue font_size=14pt textdecoration=underline font_style=italic]Conclusion}";

title h=14pt color=black bold 'this is a sas title';

ods tagsets.rtf close;

 

The result is:

 

this is a text line

This is a second line of text

Conclusion

 

 

 

 

 

 

 

Super User
Posts: 7,762

Re: title is not working with SAS EG 5.1 using ods tagsets.rtf

A title defined with a title statement will be added to the output created by procedures that produce output. The title statement just defines the title, but does not add anything to the output. Once a subsequent procedure creates output, the defined title(s) will be added to the output automatically.

 

Your code has no output procedure.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 7,762

Re: title is not working with SAS EG 5.1 using ods tagsets.rtf

PS do this for a test:

ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);
ODS _ALL_ CLOSE;
proc template;
define style Styles.UserText;
parent = Styles.Default;
CLASS UserText from SystemTitle /
just=Left
FONT_FACE = "Arial, Helvetica, sans-serif"
fontstyle=roman
fontsize=12pt
fontweight=bold
color=black;
end;
run;
ods escapechar='^';
ods tagsets.rtf file='\\AHOMEDIRPNAS\Homedirp\ALE252\Travail\Temp2\test4.rtf' startpage=no style=Styles.UserText options (Tables_OFF='usertext');
ods tagsets.rtf text='this is a text line';
ods tagsets.rtf text="^{style[ color = red font_size=14pt font_style=italic] This is a second line of text}";
ods tagsets.rtf text="^{style[ just=c color= blue font_size=14pt textdecoration=underline font_style=italic]Conclusion}";
title h=14pt color=black bold 'this is a sas title';

proc print data=sashelp.class;
run;

ods tagsets.rtf close;
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 43

Re: title is not working with SAS EG 5.1 using ods tagsets.rtf

Posted in reply to KurtBremser

Thanks you Kurt!  In that case, the title option may not be appropriate for what I would like to do.

 

If you looks at my original code, the third line of text as an justify option but it is not working.

ods tagsets.rtf text="^{style[ just=c color= blue font_size=14pt textdecoration=underline font_style=italic]Conclusion}";

 

The word Conclusion is blue, italic, underline but justify = left, the justification from the proc format. Is there a way to change the justification of a line of text with ods tagsets.rtf text?

 

Regards,

Alain

 

 

Super User
Posts: 7,762

Re: title is not working with SAS EG 5.1 using ods tagsets.rtf

Since ods text delivers raw text to the destination, I have an inkling that just=c is not valid rtf style syntax, and the justification needs to be delivered differently.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 4 replies
  • 121 views
  • 0 likes
  • 2 in conversation