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!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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