<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROC TABULATE column borders in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978189#M84072</link>
    <description>&lt;P&gt;With style inheritance, you will get more borders than you want. I tried PROC REPORT, and the trick is getting only 14 to have a right border. You can see the two attempts I tried below, which still does not give you exactly what you describe. I think you can adapt this SAS Note which requires creating multiple formats:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/39/652.html" target="_blank"&gt;https://support.sas.com/kb/39/652.html&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
ods escapechar='^';
ods pdf file="c:\temp\foo.pdf" style=journal;

proc tabulate data=sashelp.class ;
  class name sex;
  class age / style=&amp;lt;parent&amp;gt;;
  classlev sex/style={borderrightcolor=red borderrightwidth=2} ;
  classlev age/ style=&amp;lt;parent&amp;gt;;
  tables name="",sex=""*age=""*[style=&amp;lt;parent&amp;gt;];
  where age IN (13,14) ;
  keyword n / style=&amp;lt;parent&amp;gt;;
run ;

proc report data=sashelp.class missing;
column name sex,((age,n)) dummy ;
define name / ' ' group;
define sex / across ' ' style(header)=[borderrightcolor=red borderrightwidth=2];
define age / across ' ' style(header)=[borderrightcolor=red borderrightwidth=2];
define n / ' ';
define dummy / computed noprint;
where age IN (13,14) ;

compute dummy;
call define('_c3_','style','style=[borderrightcolor=red borderrightwidth=2]');
call define('_c5_','style','style=[borderrightcolor=red borderrightwidth=2]');
endcomp;
run;

data class;
set sashelp.class;
blankcol=1;
run;

proc report data=class missing;
column name sex,((age,n) blankcol);
define name / ' ' group;
define sex / across ' ' style(header)=[borderrightcolor=red borderrightwidth=2];
define age / across ' ' ;
define n / ' ';
define blankcol / ' ' style(column header)=[foreground=red background=red cellwidth=.1in];
where age IN (13,14) ;

run;

ods pdf close ;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 Oct 2025 17:57:14 GMT</pubDate>
    <dc:creator>Kathryn_SAS</dc:creator>
    <dc:date>2025-10-31T17:57:14Z</dc:date>
    <item>
      <title>PROC TABULATE column borders</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978186#M84071</link>
      <description>&lt;P&gt;Using PROC TABULATE, in a table that has two levels of columns headings, is there a way to get vertical borders between the major headings, that extend through the entire table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below I can specify a border on the CLASSLEV statement, but it only applies to the heading, it is not actually inherited by the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf file="%sysfunc(pathname(work))/foo.pdf" style=journal;
proc tabulate data=sashelp.class ;
  class name age sex;
  classlev sex/style={borderrightcolor=red borderrightwidth=2} ;
  tables name="",sex=""*age="";
  where age IN (13,14) ;
run ;
ods pdf close ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It generates:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1761927789272.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111067iD1FCD4AC12BCDC30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1761927789272.png" alt="Quentin_0-1761927789272.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would like the red lines to extend down through the entire table, to separate the gender groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps this can be done with inheritance?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 16:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978186#M84071</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-10-31T16:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE column borders</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978189#M84072</link>
      <description>&lt;P&gt;With style inheritance, you will get more borders than you want. I tried PROC REPORT, and the trick is getting only 14 to have a right border. You can see the two attempts I tried below, which still does not give you exactly what you describe. I think you can adapt this SAS Note which requires creating multiple formats:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/39/652.html" target="_blank"&gt;https://support.sas.com/kb/39/652.html&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
ods escapechar='^';
ods pdf file="c:\temp\foo.pdf" style=journal;

proc tabulate data=sashelp.class ;
  class name sex;
  class age / style=&amp;lt;parent&amp;gt;;
  classlev sex/style={borderrightcolor=red borderrightwidth=2} ;
  classlev age/ style=&amp;lt;parent&amp;gt;;
  tables name="",sex=""*age=""*[style=&amp;lt;parent&amp;gt;];
  where age IN (13,14) ;
  keyword n / style=&amp;lt;parent&amp;gt;;
run ;

proc report data=sashelp.class missing;
column name sex,((age,n)) dummy ;
define name / ' ' group;
define sex / across ' ' style(header)=[borderrightcolor=red borderrightwidth=2];
define age / across ' ' style(header)=[borderrightcolor=red borderrightwidth=2];
define n / ' ';
define dummy / computed noprint;
where age IN (13,14) ;

compute dummy;
call define('_c3_','style','style=[borderrightcolor=red borderrightwidth=2]');
call define('_c5_','style','style=[borderrightcolor=red borderrightwidth=2]');
endcomp;
run;

data class;
set sashelp.class;
blankcol=1;
run;

proc report data=class missing;
column name sex,((age,n) blankcol);
define name / ' ' group;
define sex / across ' ' style(header)=[borderrightcolor=red borderrightwidth=2];
define age / across ' ' ;
define n / ' ';
define blankcol / ' ' style(column header)=[foreground=red background=red cellwidth=.1in];
where age IN (13,14) ;

run;

ods pdf close ;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Oct 2025 17:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978189#M84072</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-10-31T17:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE column borders</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978191#M84073</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13770"&gt;@Kathryn_SAS&lt;/a&gt;&amp;nbsp;, helpful examples.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Luckily for me,&amp;nbsp; my actual example is different than I posted.&amp;nbsp; Within the gender columns, I calculate a mean and std dev.&amp;nbsp; This allows me to specify a border on the std dev column, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf file="%sysfunc(pathname(work))/foo.pdf" style=journal;
proc tabulate data=sashelp.class ;
  class name sex;
  var height ;
  classlev sex/style={borderrightcolor=red borderrightwidth=2} ;
  tables name="",sex=""*height=""*(mean stddev*{style={borderrightcolor=red borderrightwidth=2}});
  keyword stddev/style={borderrightcolor=red borderrightwidth=2} ; 
  where age IN (13,14) ;
run ;
ods pdf close ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1761939506041.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111068i881F312653E366BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1761939506041.png" alt="Quentin_0-1761939506041.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 19:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-column-borders/m-p/978191#M84073</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-10-31T19:39:03Z</dc:date>
    </item>
  </channel>
</rss>

