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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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