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
SAS Super FREQ
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.

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
  • 2 replies
  • 4563 views
  • 0 likes
  • 2 in conversation