<?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: sum for character variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849594#M335869</link>
    <description>&lt;P&gt;This is a 'vertical' som of all the values of Charsales? If you want a different result, then please be specific about your desired result.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2022 10:33:30 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-12-14T10:33:30Z</dc:date>
    <item>
      <title>sum for character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849590#M335866</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data hsum;
input ID Trans Sales $;
datalines;
01 1 $135.00
01 1 $75.00
01 1 $140.00
01 2 $140.00
02 1 $220.00
03 1 $135.00
03 1 $125.00
03 2 $80.00
;
run;

proc sql;
select * ,sum(input(Sales,?best12.))as totals from hsum;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;how to sum above char sales varibale&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 10:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849590#M335866</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2022-12-14T10:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: sum for character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849591#M335867</link>
      <description>&lt;P&gt;Use an appropriate informat like dollar8.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * ,sum(input(Sales, dollar8.2))as totals from hsum;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Dec 2022 10:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849591#M335867</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-12-14T10:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: sum for character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849593#M335868</link>
      <description>&lt;P&gt;&amp;nbsp;vertical sum&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 10:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849593#M335868</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2022-12-14T10:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: sum for character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849594#M335869</link>
      <description>&lt;P&gt;This is a 'vertical' som of all the values of Charsales? If you want a different result, then please be specific about your desired result.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 10:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849594#M335869</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-12-14T10:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: sum for character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849597#M335871</link>
      <description>&lt;P&gt;With all due respect, do not make numeric variables into character variables. This causes problems, and we see this repeatedly, over and over again, in this forum, people have numbers as character variables, and they don't know how to handle this. If you are in control of the creation of this data set, do not make numbers character variables. If you are not in control (someone sent it to you), create numeric variables to replace the character variables, and then summing is easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simple things like this, following good practices rather than bad practices, will help you hugely in your SAS career.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 11:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-for-character-variables/m-p/849597#M335871</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-14T11:14:05Z</dc:date>
    </item>
  </channel>
</rss>

