kstats9pt3
kstats9pt3

Reputation: 873

Merging Cells in Output RTF from PROC REPORT

After looking online and not quite finding what I need -- is it possible to merge cells downward in an output RTF file using PROC REPORT? Below is an example of a specific study day from my PROC REPORT:

enter image description here

For some study days, there are multiple Tukey results as shown in this example. For others, there are single rows with no Tukey results and thus do not need merged. I'd like for my table to output as such:

enter image description here

Below is my SAS code -- can anything be added or would changes need to be made in the custom template I'm using?

ODS RTF FILE="&RESULTS\TEST.RTF" STYLE=CUSTOM;
proc report data = test nofs;
    column DAY _1 _2 _3 _4 _5 SHIFT_P STR;
    define DAY / group "Study Day" order=data;    
    define _1 / group "1";
    define _2 / group "2";
    define _3 / group "3";
    define _4 / group "4";
    define _5 / group "5";
    define SHIFT_P / group "Group Effect P-Value";    
    define STR / display "Estimated Difference (Relationship) Tukey's P-Value";
run;
ODS RTF CLOSE;

Upvotes: 1

Views: 2079

Answers (1)

Joe
Joe

Reputation: 63434

You may be able to use the SPANROWS option on the PROC REPORT statement. Here's a simplified example:

ODS RTF FILE="c:\temp\TEST.RTF";
proc report data = SASHELP.CARS nofs spanrows;
    column Make Origin Drivetrain;
    define Make / group "Make" order=data ;    
    define Origin / group "Origin";    
    define Drivetrain / group "Drivetrain";
run;
ODS RTF CLOSE;

SPANROWS is available as of 9.2.

Upvotes: 2

Related Questions