<?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: multiple one-way freq tables via proc tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/534563#M146699</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I write "not working" and I said that the problem is with titles.&lt;/P&gt;
&lt;P&gt;You could run it and see it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, but you did not actually include what the output should look like. So I was guessing at the desired result.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Feb 2019 18:50:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-02-11T18:50:51Z</dc:date>
    <item>
      <title>multiple one-way freq tables via proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532510#M145923</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am trying to create multiple one-way freq tables via proc tabulate.&lt;/P&gt;
&lt;P&gt;For each table I want to create a separate title.&lt;/P&gt;
&lt;P&gt;Why is it not working???&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.heart;
  class chol_status bp_status  sex;

  title 'chol_status field';
  table chol_status='' All,n='people' pctn='%people'*f=pctfmt./box='cholesterol';

  title 'bp_status field';
  table bp_status='' All,n='people' pctn='%people'*f=pctfmt./box='BP ';

  title 'sex field';
  table sex='' All,n='people' pctn='%people'*f=pctfmt./box='Gender';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 06:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532510#M145923</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-04T06:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: multiple one-way freq tables via proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532527#M145929</link>
      <description>&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In place of title you can use&amp;nbsp;&lt;CODE class=" language-sas"&gt;pretext&lt;/CODE&gt; style options in table statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.heart;
  class chol_status bp_status  sex;

  table chol_status='' All,n='people' pctn='%people'*f=pctfmt./box='cholesterol' 
   style=[pretext='chol_status field'];
   
  
  table bp_status='' All,n='people' pctn='%people'*f=pctfmt./box='BP '
  style=[pretext='bp_status field'];;
   

  table sex='' All,n='people' pctn='%people'*f=pctfmt./box='Gender'
  style=[pretext='sex field'];
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532527#M145929</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2019-02-04T10:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: multiple one-way freq tables via proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532528#M145930</link>
      <description>&lt;P&gt;title is a global statement which is executed immediately when encountered in the code.&lt;/P&gt;
&lt;P&gt;The proc tabulate code is fetched until a step boundary is encountered, and executed then.&lt;/P&gt;
&lt;P&gt;So your code is equivalent to this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title 'chol_status field';
title 'bp_status field';
title 'sex field';

proc tabulate data=sashelp.heart;
  class chol_status bp_status  sex;

  table chol_status='' All,n='people' pctn='%people'*f=pctfmt./box='cholesterol';

  table bp_status='' All,n='people' pctn='%people'*f=pctfmt./box='BP ';

  table sex='' All,n='people' pctn='%people'*f=pctfmt./box='Gender';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You need to do three separate proc tabulates.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532528#M145930</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-04T10:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: multiple one-way freq tables via proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532610#M145954</link>
      <description>&lt;P&gt;"Not working" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your output does consist of three separate tables I have to &lt;STRONG&gt;guess&lt;/STRONG&gt; that your complaint is that you get the LAST defined title for all three tables. That is way the TITLE statement works for any procedure with multiple tables; they all get the same title.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use Style= Pretext to place different text before each table&lt;/P&gt;
&lt;PRE&gt;title;/* turn off existing titles*/
proc tabulate data=sashelp.heart;
  class chol_status bp_status  sex;

  table chol_status='' All,n='people' pctn='%people'*f=pctfmt.
   /box='cholesterol' style=[Pretext='chol_status field'];

  table bp_status='' All,n='people' pctn='%people'*f=pctfmt.
   /box='BP ' style=[Pretext='bp_status field'];

  table sex='' All,n='people' pctn='%people'*f=pctfmt.
   /box='Gender' style=[Pretext='sex field'];
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Feb 2019 16:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/532610#M145954</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-04T16:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: multiple one-way freq tables via proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/534251#M146575</link>
      <description>&lt;P&gt;When I write "not working" and I said that the problem is with titles.&lt;/P&gt;
&lt;P&gt;You could run it and see it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 04:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/534251#M146575</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-10T04:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: multiple one-way freq tables via proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/534563#M146699</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I write "not working" and I said that the problem is with titles.&lt;/P&gt;
&lt;P&gt;You could run it and see it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, but you did not actually include what the output should look like. So I was guessing at the desired result.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 18:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-one-way-freq-tables-via-proc-tabulate/m-p/534563#M146699</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-11T18:50:51Z</dc:date>
    </item>
  </channel>
</rss>

