Hi, All:
I am trying to generate output like this in RTF Output, which has one merged cell (Column No.2 + Column No. 3)
I think nested structure in column statement is one of solutions, but I do not know how to write code.
I attached example code. Please help me.
Thank you in advance.
data test;
length column1-column3 $200.;
column1="aaaaa"; column2="bbbbb"; column3="ccccc"; output;
run;
ods rtf file="SpecifyYourFolder\test.rtf";
proc report data=test nowindows
style(header)={backgroundcolor=white fontweight=light fontsize=8pt fontfamily="Times New Roman"}
style(report)={rules=groups frame=hsides borderwidth=0.5pt bordercolor=black}
;
column
column1
(
"BBB+CCC" column2 column3
)
;
define column1 / display "AAAAA";
define column2 / display "";
define column3 / display "";
run;
quit;
ods rtf close;
Consider
proc report data=test nowindows
style(header)={backgroundcolor=white fontweight=light fontsize=8pt fontfamily="Times New Roman"}
style(report)={rules=groups frame=hsides borderwidth=0.5pt bordercolor=black}
;
column
("AAAAA" column1)
("BBB+CCC" column2 column3 )
;
define column1 / display "" ;
define column2 / display "";
define column3 / display "";
run;
quit;
Mixing the way you define the column headings between DEFINE and COLUMN statements is adding the additional row,
Consider
proc report data=test nowindows
style(header)={backgroundcolor=white fontweight=light fontsize=8pt fontfamily="Times New Roman"}
style(report)={rules=groups frame=hsides borderwidth=0.5pt bordercolor=black}
;
column
("AAAAA" column1)
("BBB+CCC" column2 column3 )
;
define column1 / display "" ;
define column2 / display "";
define column3 / display "";
run;
quit;
Mixing the way you define the column headings between DEFINE and COLUMN statements is adding the additional row,
Hi, ballardw-san:
Thank you for your quick reply. Your code worked for me.
Yes, I had trouble with additional row that I do not intend.
Thanks to your explanation, I understand.
Thank you for giving details!!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.