The SAS Output Delivery System and reporting techniques

Proc Report Format In ODS (Need to merge Row)

Reply
Contributor
Posts: 24

Proc Report Format In ODS (Need to merge Row)

Proc Report ODS Format Question

I need to have the text “Header I Want In Merged Row” in a merged cell (Or new row) that spans the entire table(s) of 4 columns.

The text “Header I Want To Span Var1 and Var1” should only span the two columns Var1 and Var2.

Like this:

_______________________________________Header I Want In Merged Row________________________________

             Header I want to Span Var1 and Var2           Header I want to Span Var1 and Var2

       Var1           Var2                                     Var1             Var2

Here is the code I am using, right now the first two text lines are showing up under the 2 columns.

ods layout start columns=2;

option center;

ods region;

/* First Table */

proc report data=XXX split='*' nowd

  style(header)=[backgroundcolor=#FAF3D4 foreground=Black just=center   ];

  column (“Header I Want In Merged Row**Header I Want To Span Var1 and Var1' Var1 Var2 ) ;

  define Var1 / style(column) = {cellwidth=1.5in just=center  }

                 style(header)= {cellwidth=1.5in just=center background=white foreground=black };

  define Var2 / style(column)= {cellwidth=1.5in just=center }

                     style(header)= {cellwidth=1.5in just=center  background=white foreground=black };

run;

/* Second Table */

ods region;

proc report data=XXX split='*' nowd

  style(header)=[backgroundcolor=#FAF3D4 foreground=Black just = center ];

  column ((“Header I Want In Merged Row** Header I Want To Span Var1 and Var3' Var1 Var3) ;

  define Var1 / style(column) = {cellwidth=1.5in just=center  }

                 style(header)= {cellwidth=1.5in just=center background=white foreground=black  };

  define Var3 / style(column)= {cellwidth=1.5in just=center }

                     style(header)= {cellwidth=1.5in just=center  background=white foreground=black };

run;

ods layout end;

TIA..

J

Regular Contributor
Regular Contributor
Posts: 166

Proc Report Format In ODS (Need to merge Row)

Hi,

I think what you are looking for is a title before your ods layout...

I cannot test this right now but i remember using something like the below code.

ods escapechar="~";

title "~{style [ just=center] This is my title}"; 

Hope it helps.

Ask a Question
Discussion stats
  • 1 reply
  • 291 views
  • 0 likes
  • 2 in conversation