BookmarkSubscribeRSS Feed
Sally_Caffrey
Obsidian | Level 7

I want to add a topline above "TRT" row for the table. I tried style(report) and style(header), they both did not add the line in the correct position. Here is my program:

ods rtf file='c:\temp\temp.rtf' startpage=no style=journal bodytitle;
proc report data=final  nowindows headline headskip split = '|' missing  
			style(report)={FONTSIZE = 10pt}
			;
    column trt tptn tpt 
        ("(*ESC*)S={borderbottomcolor=black borderbottomwidth=2} TRT"  n3 mean3 sd3 median3 min3 max3 GeomMean3 CV3);
	define trt/group noprint; 
    define tptn/order order=internal noprint;
	define tpt/group "Time Point" style=[just=l cellwidth=15%];
        .....
run;
ods rtf close.

and my table looks like 

Sally_Caffrey_1-1712394276237.png

What I want is

Sally_Caffrey_2-1712394404201.png

How should I modify the program? Thank you.

2 REPLIES 2
Mazi
Pyrite | Level 9
data class;
	set sashelp.class;
	length agegr1 $7;
	if age<13 then agegr1 = '<13';
	else if age < 15 then agegr1 = '13-<15';
	else agegr1='>=15';
run;

proc sort data=class;
	by agegr1;
run;

data final;
	set class;
	by agegr1;
	if first.agegr1 then page+1;
run;

ods rtf file="./temp.rtf" style=RTFStyle;

PROC REPORT data=final headline headskip nowd split="~" spacing=0 missing
   style(header) = {vjust = middle font_size = 8pt font_face="Courier New"}
   style(column) = {just=l vjust = middle font_size = 8pt font_face="Courier New"}
   style(report) = {rules = groups frame = void cellpadding = 1 font_face="Courier New"}
   style(lines)  = {font_size = 8pt}   ;
   column page name sex ("^S={borderbottomcolor=black borderbottomwidth=1} Baseline Characteristics" age height weight) agegr1;
   define name / order order = internal style(header)=[just=l] style(column)=[just=l cellwidth=20%];
   define page / order order = internal noprint;
   define agegr1 /  noprint;
   define sex  / style(header)=[just=l] style(column)=[just = l cellwidth=19%];
   define age   /style(column) = {just=c cellwidth = 20%};
   define height / style(column) = {just=c cellwidth = 20%};
   define weight / style(column) = {just=c cellwidth = 20%};
   compute before _page_ /style=[borderbottomcolor=black borderbottomwidth=1];
		len=length(agegr1);
		line @1 "Age Group: " agegr1 $varying.len;
	endcomp;
	break after page / page;
run;
ods rtf close;

Can you try adding a style to the compute before _page_ block? 

Mazi_0-1712408174939.png

 

Ksharp
Super User

That would be better if you could post some test data.

And I could not replicate your problem by your code.

And the following code is an alternative way to get what you want.

 

ods rtf file='c:\temp\temp.rtf' startpage=no style=journal bodytitle;
proc report data=sashelp.heart(obs=10)  nowindows headline headskip split = '|' missing  
			style(report)={FONTSIZE = 10pt outputwidth=100%}
			;
    column status sex bp_status
        ("(*ESC*)R'\brdrb\brdrs\brdrw15' TRT"  weight height ageatstart);
	define status/group noprint; 
    define sex/order order=internal noprint;
	define bp_status/group "Time Point" style=[just=l cellwidth=15%];
run;
ods rtf close;

Ksharp_0-1712452406651.png

 

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