BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I want the header to be displayed in proc report with RTF option to look like this;

Placebo (N=n) SB-509 (N=n)
Mild Moderate Severe Mild Moderate Severe


I am using the following syntax for column in proc report. &var3 macro corresponds to (N=n). Everything except the (N=n) is getting displayed properly, because I assume the '^R/RTF doesnot recognize the macro variable &var3. Is their a way to get around this?



columns PLAN P1 PT_NM ('^R/RTF"\brdrb\brdrs\brdrw1" Placebo (&var3) |' MILD MODERATE SEVERE) EMPTY ('^R/RTF"\brdrb\brdrs\brdrw1" SB-509 (&var2)|' MILD MODERATE SEVERE) ;
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
Try putting the RTF "raw" text in single quotes and that will allow you to put your macro variable reference inside double quotes -- so it can resolve. A macro variable won't resolve if surrounded by single quotes. I just used SASHELP.CLASS for the report and STYLE=JOURNAL for the style.

cynthia
[pre]
%let var3 = %str(N=5);
%let var2 = %str(N=5);

ods listing close;
ods rtf file='trybrdrb.rtf' style=journal;
ods escapechar='^';

proc report data=sashelp.class(obs=5) nowd;
columns name
("^R/RTF'\brdrb\brdrs\brdrw1' Placebo (&var3) " height weight)
("^R/RTF'\brdrb\brdrs\brdrw1' SB-509 (&var2)" sex age) ;
run;
ods rtf close;
[/pre]
deleted_user
Not applicable
Thanks for the help.

I figured that out after posting my question.

Thanks again for the help.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 5170 views
  • 0 likes
  • 2 in conversation