<?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: adding percent to proc sql table sas 9.4 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921854#M363017</link>
    <description>&lt;P&gt;It is not clear what percentage you are talking about.&lt;/P&gt;
&lt;P&gt;Why would you use SQL to do that instead of a PROC like TABULATE which is designed to make sure reports?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2024 19:41:29 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-03-26T19:41:29Z</dc:date>
    <item>
      <title>adding percent to proc sql table sas 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921853#M363016</link>
      <description>&lt;P&gt;Is there a way to add percent of the total for each clinic_name into this table?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql ;
create table Gender as
select Clinic_Name,Gender, count(distinct ID)as Distinc_count, sum( Cost) as cost
from have
where Clinic_Type='1' and Cost&amp;gt;1 and SFY='2023'
group by Clinic_Name, Gender;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is how I would like it to look:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip.PNG" style="width: 501px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94953i92AA1E266FFAC547/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip.PNG" alt="snip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 19:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921853#M363016</guid>
      <dc:creator>Whitlea</dc:creator>
      <dc:date>2024-03-26T19:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: adding percent to proc sql table sas 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921854#M363017</link>
      <description>&lt;P&gt;It is not clear what percentage you are talking about.&lt;/P&gt;
&lt;P&gt;Why would you use SQL to do that instead of a PROC like TABULATE which is designed to make sure reports?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 19:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921854#M363017</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-26T19:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: adding percent to proc sql table sas 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921897#M363050</link>
      <description>&lt;P&gt;Looks like you want a report, not a data set.&amp;nbsp; Consider something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  picture mypct low-high=' 009.9% ';
run;
proc tabulate data=have noseps;
  class clinic gender ;
  var cost;
  table  clinic=' ' * gender=' '
       , N='Count'*f=5.0  sum=' '*cost='Cost'*f=dollar13.0
                          cost=' '*pctsum&amp;lt;gender&amp;gt;='%'*f=mypct.
       /Box="Clinic   Gender"  rts=20;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I guess the percents that you want are percent cost for a given gender within a given clinic.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 01:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-percent-to-proc-sql-table-sas-9-4/m-p/921897#M363050</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-03-27T01:58:42Z</dc:date>
    </item>
  </channel>
</rss>

