<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167275#M43316</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't say what type of variable your ASSET_BUCKET is. If it appears as a numeric in the range 0 to some max value you probably want a format to group&amp;nbsp; and control appearance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc format;&lt;/P&gt;&lt;P&gt;value Asset_bucket&lt;/P&gt;&lt;P&gt;0 -&amp;lt; 100 = '&amp;nbsp;&amp;nbsp; x &amp;lt; 100'&lt;/P&gt;&lt;P&gt;100 -&amp;lt;500= '100&amp;lt;=x&amp;lt;500'&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 598px;"&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;500 -&amp;lt;1000 = '500&amp;lt;=x&amp;lt;1000'&lt;/P&gt;&lt;P&gt;1000-high = 'x&amp;gt;=1000'&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may also what a different format for the PCT calls as by default you'll likely get 2 decimals and no % sign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Associate that format with the asset_buckets variabl with a format statement in proc tabulate.&lt;/P&gt;&lt;P&gt;You may need a separate class statment to set order=internal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 May 2014 17:13:58 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-05-22T17:13:58Z</dc:date>
    <item>
      <title>Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167271#M43312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question below, how to create a table as below?&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="598"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="74"&gt;Branch&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="111"&gt;Asset buckets&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Count&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="95"&gt;Perc_Count&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="125"&gt;Tot_Asset&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="129"&gt;Perc_Tot_Asset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="100" rowspan="5" style="border-top: none;"&gt;123&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;x&amp;lt;100&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;23&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;17%&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;100000&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none; border-left: none;"&gt;100&amp;lt;=x&amp;lt;500&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;9%&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3000002&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;9%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none; border-left: none;"&gt;500&amp;lt;=x&amp;lt;1000&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;43&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;31%&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6223444&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;18%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none; border-left: none;"&gt;x&amp;gt;=1000&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;61&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;44%&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;25777532&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;73%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none; border-left: none;"&gt;total&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;139&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;100%&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;35100978&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167271#M43312</guid>
      <dc:creator>Kitty_Zhu</dc:creator>
      <dc:date>2014-05-21T10:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167272#M43313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a template. It may have several branches, and I want to obtain the count(and percent of count) and sum(and percent of sum) of assets by branch*asset buckets...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167272#M43313</guid>
      <dc:creator>Kitty_Zhu</dc:creator>
      <dc:date>2014-05-21T10:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167273#M43314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Several ways of doing it, you could use means/freq procedures.&amp;nbsp; My preference is SQL so:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Create empty shell */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BRANCH char(200),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASSET_BUCKETS char(200),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT num,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERC_COUNT char(200)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Insert the rows */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into WANT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BRANCH="123",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASSET_BUCKETS="x&amp;lt;100",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT=(select count(1) from HAVE where ASSET_BUCKET="x&amp;lt;100"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERC_COUNT=strip(put((select count(1) from HAVE where ASSET_BUCKET="x&amp;lt;100") / whatever total is * 100,best.)||"%",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167273#M43314</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-21T10:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167274#M43315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this using proc tabulate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;tabulate&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=have&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;class &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;branch asset_buckets;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;var Asset;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;keylabel &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;all&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Total'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;branch&lt;/SPAN&gt;*(asset_buckets all), Asset*(n=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Count'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;f&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;8.0 &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;pctn&amp;lt;asset_buckets all&amp;gt;=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Perc_Count'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum=&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Tot_Asset'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;f&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;8.0 &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;pctsum&amp;lt;asset_buckets all&amp;gt;='&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;Perc_Tot_Asset&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167274#M43315</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-05-21T10:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167275#M43316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't say what type of variable your ASSET_BUCKET is. If it appears as a numeric in the range 0 to some max value you probably want a format to group&amp;nbsp; and control appearance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc format;&lt;/P&gt;&lt;P&gt;value Asset_bucket&lt;/P&gt;&lt;P&gt;0 -&amp;lt; 100 = '&amp;nbsp;&amp;nbsp; x &amp;lt; 100'&lt;/P&gt;&lt;P&gt;100 -&amp;lt;500= '100&amp;lt;=x&amp;lt;500'&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 598px;"&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;500 -&amp;lt;1000 = '500&amp;lt;=x&amp;lt;1000'&lt;/P&gt;&lt;P&gt;1000-high = 'x&amp;gt;=1000'&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may also what a different format for the PCT calls as by default you'll likely get 2 decimals and no % sign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Associate that format with the asset_buckets variabl with a format statement in proc tabulate.&lt;/P&gt;&lt;P&gt;You may need a separate class statment to set order=internal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 17:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate/m-p/167275#M43316</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-22T17:13:58Z</dc:date>
    </item>
  </channel>
</rss>

