DATA Step, Macro, Functions and more

ods tagset.rtf text

Reply
Contributor
Posts: 26

ods tagset.rtf text

Hello,

 

I wish to produce a word document using sas (ods rtf file). Obviously, I need to use the swith to ods tagset.rtf in order to use the options (Tables_off ='usertext').  Does it exist the equivalent of this option with ods rtf file?

 

Is there a way to pass font control option with text such as those below:

 

ods listing close;
ods escapechar='^';

ods tagsets.rtf file='/folders/myfolders/x.rtf' options (TABLES_OFF='usertext');

ods tagsets.rtf text="^S={just=c fontweight=bold fontsize=24pt color=black}First Report";
ods tagsets.rtf text="^S={just=l fontweight=bold fontsize=12pt color=red}Second Report";


ods _all_ close;

 

Those options does not seem to be recongnized by SAS

Any suggestions?

Regards,

Trusted Advisor
Posts: 1,128

Re: ods tagset.rtf text

I believe the options (Tables_off ='usertext') is correct. Here the usertext is a style element and it is case sensitive. so you should mention it in upcase like below

(Tables_off ='USERTEXT')

Please try
Thanks,
Jag
Super User
Posts: 10,486

Re: ods tagset.rtf text


alepage wrote:

Hello,

 

I wish to produce a word document using sas (ods rtf file). Obviously, I need to use the swith to ods tagset.rtf in order to use the options (Tables_off ='usertext').  Does it exist the equivalent of this option with ods rtf file?

 

Is there a way to pass font control option with text such as those below:

 

ods listing close;
ods escapechar='^';

ods tagsets.rtf file='/folders/myfolders/x.rtf' options (TABLES_OFF='usertext');

ods tagsets.rtf text="^S={just=c fontweight=bold fontsize=24pt color=black}First Report";
ods tagsets.rtf text="^S={just=l fontweight=bold fontsize=12pt color=red}Second Report";


ods _all_ close;

 

Those options does not seem to be recongnized by SAS

Any suggestions?

Regards,


And what makes you think that the statements aren't recognized?

 

I get expected output when l open the output using a different file path of course.

Contributor
Posts: 26

Re: ods tagset.rtf text

the options (Tables_off ='usertext') works fine, but I am not able to center my text , to change the font or to get it bold.

Any suggestions because the follow lines of code do not works at all.

 

ods tagsets.rtf text="^S={just=c fontweight=bold fontsize=24pt color=black}First Report";
ods tagsets.rtf text="^S={just=l fontweight=bold fontsize=12pt color=red}Second Report";

 

SAS Super FREQ
Posts: 8,742

Re: ods tagset.rtf text

Hi, I have always used the style template method shown in this Tech Support note for the ODS RTF example: http://support.sas.com/techsup/notes/v8/8/044.html

cynthia
Contributor
Posts: 26

Re: ods tagset.rtf text

Hello Cynthia,

 

Does template will work with ods  tagset.rtf text ?  Could you please provide me an example which works?

Regards,

 

Alain

SAS Super FREQ
Posts: 8,742

Re: ods tagset.rtf text

[ Edited ]

Hi: The example of the PROC TEMPLATE on the full code tab from the Tech Support note is what I used for the screen shot below. I did make a few changes. I put an ODS PATH statement to write the template to work. I also changed the font size, color and alignment in the template, so I could override using the newer function style ESCAPECHAR syntax in the RTF step. I have 2 ODS "sandwiches" -- one for tagsets.rtf and the other for the original rtf. As you can see, the style template styles.utext was used by both destinations. I also included a SAS Title statement so you could see the difference between how the TITLE statement is handled in the 2 different destinations.

 

  The style template should be honored by any destination that uses it (assuming that the style element is in your output and the style attributes you changed are used by that destination).

 

cynthia

change_style_template.png

Contributor
Posts: 26

Re: ods tagset.rtf text

Good morning Cynthia,

 

Thanks a lot for your help.  I have test the code you sent to me and it works fine. 

Moreover, I have made extra test with my original code and I found that just=l or just=c does not seem to work and when i use justify, the rest of the style is ignored.

 

The following code is not working:

 

ods listing close;
ods escapechar='^';

ods tagsets.rtf file='/folders/myfolders/x.rtf' options (TABLES_OFF='usertext');

ods tagsets.rtf text="^S={just=c fontweight=bold fontsize=24pt color=black}First Report";
ods tagsets.rtf text="^S={just=l fontweight=bold fontsize=12pt color=red}Second Report";


ods _all_ close;

 

The one is working (no justify option)

 

ods listing close;
ods escapechar='^';

ods tagsets.rtf file='/folders/myfolders/x.rtf' options (TABLES_OFF='usertext');

ods tagsets.rtf text="^S={ fontweight=bold fontsize=24pt color=black}First Report";
ods tagsets.rtf text="^S={ fontweight=bold fontsize=12pt color=red}Second Report";


ods _all_ close;

 

I don't understand why but it is the way it works.

Thanks again for your help.

Regards,

 

Alain

Ask a Question
Discussion stats
  • 7 replies
  • 189 views
  • 0 likes
  • 4 in conversation