<?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 PCT from total for each field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/724969#M225110</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I would like to get the following summary table which calculate percent from total for each category of each field.&lt;/P&gt;
&lt;P&gt;May anyone show the code that can create it?&lt;/P&gt;
&lt;P&gt;Cherers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1615320897823.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55745iA02805F17705658B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1615320897823.png" alt="Ronein_0-1615320897823.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Rawtbl;
input ID field $  category  year ;
cards;
1 x 1 2020 
1 w 2 2020
1 z 2 2020
2 x 2 2020
2 w 3 2020
2 z 2 2020
3 x 2 2020
3 w 2 2020
3 z 2 2020
4 x 1 2020
4 w 2 2020
4 z 1 2020
5 x 3 2020
5 w 2 2020
5 z 2 2020
6 x 2 2021 
6 w 3 2021
6 z 1 2021
2 x 1 2021
2 w 1 2021
2 z 1 2021
3 x 2 2021
3 w 2 2021
3 z 3 2021
4 x 3 2021
4 w 2 2021
4 z 1 2021
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Mar 2021 20:16:14 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-03-09T20:16:14Z</dc:date>
    <item>
      <title>PCT from total for each field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/724969#M225110</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I would like to get the following summary table which calculate percent from total for each category of each field.&lt;/P&gt;
&lt;P&gt;May anyone show the code that can create it?&lt;/P&gt;
&lt;P&gt;Cherers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1615320897823.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55745iA02805F17705658B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1615320897823.png" alt="Ronein_0-1615320897823.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Rawtbl;
input ID field $  category  year ;
cards;
1 x 1 2020 
1 w 2 2020
1 z 2 2020
2 x 2 2020
2 w 3 2020
2 z 2 2020
3 x 2 2020
3 w 2 2020
3 z 2 2020
4 x 1 2020
4 w 2 2020
4 z 1 2020
5 x 3 2020
5 w 2 2020
5 z 2 2020
6 x 2 2021 
6 w 3 2021
6 z 1 2021
2 x 1 2021
2 w 1 2021
2 z 1 2021
3 x 2 2021
3 w 2 2021
3 z 3 2021
4 x 3 2021
4 w 2 2021
4 z 1 2021
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Mar 2021 20:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/724969#M225110</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-03-09T20:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: PCT from total for each field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/725114#M225187</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Rawtbl;
input ID field $  category  year ;
cards;
1 x 1 2020 
1 w 2 2020
1 z 2 2020
2 x 2 2020
2 w 3 2020
2 z 2 2020
3 x 2 2020
3 w 2 2020
3 z 2 2020
4 x 1 2020
4 w 2 2020
4 z 1 2020
5 x 3 2020
5 w 2 2020
5 z 2 2020
6 x 2 2021 
6 w 3 2021
6 z 1 2021
2 x 1 2021
2 w 1 2021
2 z 1 2021
3 x 2 2021
3 w 2 2021
3 z 3 2021
4 x 3 2021
4 w 2 2021
4 z 1 2021
;
run;

proc format ;
picture fmt
low-high='009.99%';
run;
proc tabulate data=rawtbl;
class category field year;
table field*(category all),year*pctn&amp;lt;category all &amp;gt;='PCT'*f=fmt8.2 /printmiss;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2021-03-10 200247.jpg" style="width: 338px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55761i44CC9DA838850647/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2021-03-10 200247.jpg" alt="屏幕截图 2021-03-10 200247.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 12:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/725114#M225187</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-03-10T12:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: PCT from total for each field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/725193#M225218</link>
      <description>Hi:&lt;BR /&gt;  Is this a new requirement for THIS same question and data? &lt;A href="https://communities.sas.com/t5/SAS-Programming/proc-tabulate-percent-from-total-column-per-each-group/m-p/725059#M225161" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/proc-tabulate-percent-from-total-column-per-each-group/m-p/725059#M225161&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 10 Mar 2021 16:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PCT-from-total-for-each-field/m-p/725193#M225218</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-03-10T16:29:31Z</dc:date>
    </item>
  </channel>
</rss>

