I use PROC REPORT to output results from two datasets, say A and B, to a single page. How could I insert a subject line on top of each of the tables? The "title" statement does not do the job. The expected output would look like the following. Thanks in advance!
Results Part A
PID | Measure A | |
101 | 1.1 | |
102 | 1.2 |
Results Part B
PID | Measure B | |
101 | 2.1 | |
102 | 2.2 |
data A B;
do PID=101 to 102; A=PID/100; B=A+1; output; end;
run;
ods rtf file='output.rtf' startpage=NO;
title 'Results Part A';
proc report data=A;
column PID A;
define A /display "Measure A";
run;
title 'Results Part B';
proc report data=B;
column PID B;
define B /display "Measure B";
run;
ods rtf close;
Have you looked at proc odstext and ods text ?
Have you looked at proc odstext and ods text ?
You can also use the BODYTITLE option of the ODS RTF statement.
See here for an example:
ods rtf file='c:\temp\output.rtf' startpage=NO bodytitle;
title 'Results Part A';
proc report data=A;
column PID A;
define A /display "Measure A";
run;
title 'Results Part B';
proc report data=B;
column PID B;
define B /display "Measure B";
run;
ods rtf close;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.