<?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: table header split problem in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507538#M21924</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I thought you wanted to change the value for the SEXF variable so that there was a line break after the subscript max. In the code you posted, you do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; if index(sexf, 'max') then
        sexf=tranwrd(sexf, 'max', '^{sub max}');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you know how to use ODS ESCAPECHAR. The ways to force the line to split for that column header are either 1) make the column width narrower to force (L) to the next line -- which may not work as you expect or 2) (a more reliable option) use ODS ESCAPECHAR to insert a line break or carriage return or new line into the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The previous posting that someone sent you showed the use of ESCAPECHAR+n, which is the older form of&amp;nbsp; the new line function. If you were going to use the newline function, it would be as shown below -- I just used SASHELP.CLASS and a format for the column headers instead of changing the variable name, but you can see the whole string you need to use to force a line break where you want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sub_linefeed.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24395i3E954FAC27BFC015/image-size/large?v=v2&amp;amp;px=999" role="button" title="sub_linefeed.png" alt="sub_linefeed.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2018 18:08:50 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-10-25T18:08:50Z</dc:date>
    <item>
      <title>table cohort varible name split problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507516#M21921</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;I have a problem with the&amp;nbsp;variable name&amp;nbsp;split. please see screen shot below. I combine cohort and unit together.&amp;nbsp;how can I split (L) to&amp;nbsp;below Fmax, &amp;nbsp;like(mg/kg)below Mmin. thanks a lot&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;currently program auto split, there should be a way to manually split.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ods escapechar='^';

proc sort data=sashelp.class out=class;
    by sex;
run;

data c1;
    set class;
    length sexf $50.;
    Weightln=log10(Weight);

    if sex='M' then
        do;
            sexf2=strip(sex)||'min';
            unit='mg/kg';
        end;

    if sex='F' then
        do;
            sexf2=strip(sex)||'max';
            unit='L';
        end;
    sexf=strip(sexf2)||' ('||strip(unit)||')';

    if index(sexf, 'max') then
        sexf=tranwrd(sexf, 'max', '^{sub max}');

    if index(sexf, 'min') then
        sexf=tranwrd(sexf, 'min', '^{sub min}');
run;

proc sort data=c1;
    by sexf;

PROC MEANS DATA=c1 NOPRINT;
    BY sexf;
    VAR Weight;
    OUTPUT OUT=AB N=N0 MEAN=Mean0 CV=CV0 STD=SD0 STDERR=SE0 LCLM=LCLM UCLM=UCLM 
        MIN=MIN0 Q1=Q10 MEDIAN=Median0 Q3=Q30 MAX=MAX0;
RUN;

proc means data=c1 noprint;
    var Weightln;
    by sexf;
    output out=cd mean=logmean var=varlog;
run;

data gcd;
    set cd;
    geomean=round(exp(logmean), .001);
run;

proc sql;
    create table all as select a.*, b.geomean from AB a left join gcd b on 
        a.sexf=b.sexf;
quit;

proc format;
    picture mnf (round) low-high='009.99';
    picture sdf (round) low-high=' 009.99)' .='N/A)' (prefix='(');
    picture minf (round) low-high='009.99;' (prefix='[');
    picture maxf (round) low-high='009.99]';
run;

PROC tabulate data=all ORDER=data;
    CLASS sexf;
    VAR n0 MEAN0 SD0 se0 cv0 q10 median0 q30 MIN0 MAX0 geomean;
    keyword mean / style=[just=R];
    keyword StD / style=[just=L];
    TABLE (n0='n'*max=''*f=4. mean0='Mean'*max=''*[style=[just=R cellwidth=70] 
        f=mnf.] SD0='(SD)'*max=''*[style=[just=L cellwidth=75] f=sdf.] 
        SE0='SE'*max=''*f=8.2 cv0='CV%'*max=''*f=8.2 Q10='Q1'*max=''*f=8.2 
        median0='Median'*max=''*f=8.2 Q30='Q3'*max=''*f=8.2 
        min0='Tmin'*max=''*f=minf. max0='Max'*max=''*f=maxf.), sexf=" " / 
        misstext='---' box=" sex" RTS=30;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24393i211020EFBA34400F/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.jpg" alt="test.jpg" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 17:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507516#M21921</guid>
      <dc:creator>magicdj</dc:creator>
      <dc:date>2018-10-25T17:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: table header split problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507521#M21922</link>
      <description>&lt;P&gt;Please check out this post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/split-character-option-in-proc-tabulate/td-p/181512" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/split-character-option-in-proc-tabulate/td-p/181512&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 16:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507521#M21922</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2018-10-25T16:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: table header split problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507533#M21923</link>
      <description>&lt;P&gt;I actually mean the variable name split, not the header.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 17:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507533#M21923</guid>
      <dc:creator>magicdj</dc:creator>
      <dc:date>2018-10-25T17:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: table header split problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507538#M21924</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I thought you wanted to change the value for the SEXF variable so that there was a line break after the subscript max. In the code you posted, you do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; if index(sexf, 'max') then
        sexf=tranwrd(sexf, 'max', '^{sub max}');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you know how to use ODS ESCAPECHAR. The ways to force the line to split for that column header are either 1) make the column width narrower to force (L) to the next line -- which may not work as you expect or 2) (a more reliable option) use ODS ESCAPECHAR to insert a line break or carriage return or new line into the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The previous posting that someone sent you showed the use of ESCAPECHAR+n, which is the older form of&amp;nbsp; the new line function. If you were going to use the newline function, it would be as shown below -- I just used SASHELP.CLASS and a format for the column headers instead of changing the variable name, but you can see the whole string you need to use to force a line break where you want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sub_linefeed.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24395i3E954FAC27BFC015/image-size/large?v=v2&amp;amp;px=999" role="button" title="sub_linefeed.png" alt="sub_linefeed.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 18:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507538#M21924</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-10-25T18:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: table header split problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507542#M21925</link>
      <description>&lt;P&gt;Cynthia, thanks a lot, it works!!!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 18:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/table-cohort-varible-name-split-problem/m-p/507542#M21925</guid>
      <dc:creator>magicdj</dc:creator>
      <dc:date>2018-10-25T18:29:02Z</dc:date>
    </item>
  </channel>
</rss>

