If you only need lines on the top and the bottom of your report, try to group also grpxsort1 variable, and add another compute block to add a line before, that's something like this:
data have;
infile cards dsd;
length ae $25;
input grp1 grp2 ae $;
cards;
1, 0, List of AE by group
1, 1, Group 1 Disorders
1, 1, Nausea
1, 1, Anaemia
1, 1, Vomiting
1, 2, Group 2 Disorders
1, 2, Pyrexia
1, 2, Fatigue
1, 2, Malaise
;
proc print;run;
ods rtf file= "&lib\have.rtf";
proc report data=have ;
column grp1 grp2 ae;
define grp1/ group noprint;
define grp2/ group noprint;
define ae/ 'Adverse Events' display;
compute before grp1;
line @1 "";
endcomp;
compute after grp2;
line @1 "";
endcomp;
run;
ods rtf close;
Output:
Style attributes could be added to apply a desired indentation and format.
... View more