BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fsu
Calcite | Level 5 fsu
Calcite | Level 5

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

PIDMeasure A 
1011.1 
1021.2 

 

Results Part B

PIDMeasure B 
1012.1 
1022.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;
1 ACCEPTED SOLUTION
3 REPLIES 3
BrunoMueller
SAS Super FREQ

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;
fsu
Calcite | Level 5 fsu
Calcite | Level 5
Both solutions are nice and working. It's not permitted, but I wish I could mark both as a solution. Thank you all!

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
  • 3 replies
  • 2308 views
  • 3 likes
  • 3 in conversation