BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KentaMURANAKA
Pyrite | Level 9

Hi, All:

 

 

I am trying to generate output like this in RTF Output, which has one merged cell (Column No.2 + Column No. 3)

ex1.PNG

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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,

View solution in original post

2 REPLIES 2
ballardw
Super User

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,

KentaMURANAKA
Pyrite | Level 9

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!!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1179 views
  • 1 like
  • 2 in conversation