BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

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,

7 REPLIES 7
Jagadishkatam
Amethyst | Level 16
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
ballardw
Super User

@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.

alepage
Barite | Level 11

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";

 

Cynthia_sas
SAS Super FREQ
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
alepage
Barite | Level 11

Hello Cynthia,

 

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

Regards,

 

Alain

Cynthia_sas
SAS Super FREQ

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

alepage
Barite | Level 11

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1521 views
  • 0 likes
  • 4 in conversation