<?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 a should convert in table b in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/table-a-should-convert-in-table-b/m-p/835012#M330073</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In order to do what you want, the PREMIUM variable will need to be numeric. You can't add or summarize PREMIUM if it stays as a character variable as you show in your posted code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Also, it's not clear if you need a TABLE as output or if you just need a REPORT. If you just need a REPORT, then either PROC REPORT or PROC TABULATE or other procedures could generate the summarized information you show. I chose PROC REPORT because the structure of the output table created in the OUT= option will be the same structure in the output dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The only tricky part is that PROC REPORT will use absolute column numbers _C3_ and _C4_ for the COVERAGE columns in the output dataset, which required a RENAME, as shown in the second examples below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1664037233192.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75552i2E1723024082FD55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1664037233192.png" alt="Cynthia_sas_0-1664037233192.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Hope this helps you with your question.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Sat, 24 Sep 2022 16:34:31 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2022-09-24T16:34:31Z</dc:date>
    <item>
      <title>table a should convert in table b</title>
      <link>https://communities.sas.com/t5/SAS-Programming/table-a-should-convert-in-table-b/m-p/835004#M330069</link>
      <description>&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;input policyno $&amp;nbsp; &amp;nbsp; coverage $&amp;nbsp; &amp;nbsp; &amp;nbsp;premium $;&lt;/P&gt;
&lt;P&gt;datalines;&lt;/P&gt;
&lt;P&gt;p1&amp;nbsp; &amp;nbsp; c1&amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;
&lt;P&gt;p1&amp;nbsp; &amp;nbsp; c2&amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;
&lt;P&gt;p2&amp;nbsp; &amp;nbsp; c1&amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;table want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;policy_no&amp;nbsp; number of coverage&amp;nbsp; &amp;nbsp; &amp;nbsp;c1&amp;nbsp; &amp;nbsp; &amp;nbsp; c2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;totalpremium&lt;/P&gt;
&lt;P&gt;p1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200&lt;/P&gt;
&lt;P&gt;p2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2022 11:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/table-a-should-convert-in-table-b/m-p/835004#M330069</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2022-09-24T11:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: table a should convert in table b</title>
      <link>https://communities.sas.com/t5/SAS-Programming/table-a-should-convert-in-table-b/m-p/835012#M330073</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In order to do what you want, the PREMIUM variable will need to be numeric. You can't add or summarize PREMIUM if it stays as a character variable as you show in your posted code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Also, it's not clear if you need a TABLE as output or if you just need a REPORT. If you just need a REPORT, then either PROC REPORT or PROC TABULATE or other procedures could generate the summarized information you show. I chose PROC REPORT because the structure of the output table created in the OUT= option will be the same structure in the output dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The only tricky part is that PROC REPORT will use absolute column numbers _C3_ and _C4_ for the COVERAGE columns in the output dataset, which required a RENAME, as shown in the second examples below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1664037233192.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75552i2E1723024082FD55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1664037233192.png" alt="Cynthia_sas_0-1664037233192.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Hope this helps you with your question.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2022 16:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/table-a-should-convert-in-table-b/m-p/835012#M330073</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-09-24T16:34:31Z</dc:date>
    </item>
  </channel>
</rss>

