<?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: summing on character variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334246#M75485</link>
    <description>&lt;P&gt;You aren't summing you're counting the number of occurrences by a categorical variable. I'm only clarifying the term so that you can search for valid solutions. Key word searches requires the correct key words and are primarily designed for English speakers.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2017 03:29:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-02-20T03:29:53Z</dc:date>
    <item>
      <title>summing on character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334238#M75481</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to sum on character variables and I'm trying to think about the best way to approach this goal. Let me sketch the rough structure of my data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; Country&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;United States&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;United States&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;France&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;Canada&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;South Africa&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;Japan&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;Japan&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;Japan&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;United States&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;Canada&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;Canada&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;Canada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the output to show me how many of each country appears for each ID, like so&amp;nbsp;:&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; Country &amp;nbsp; &amp;nbsp; &amp;nbsp; numberofoccurence&lt;/P&gt;&lt;P&gt;1 United States &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;1 Canada &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 France &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2 South Africa &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2 Japan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;3 United States &amp;nbsp;1&amp;nbsp;&lt;/P&gt;&lt;P&gt;3 Canada &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp;&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;How can I accomplish this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As always, thanks for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 02:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334238#M75481</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2017-02-20T02:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: summing on character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334239#M75482</link>
      <description>&lt;P&gt;There are multiple SAS Proc's you could use for this task.&lt;/P&gt;
&lt;P&gt;I'd probably go for Proc SQL with a count(*) in the Select statement and a &lt;EM&gt;Group By ID, Country&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 02:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334239#M75482</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-02-20T02:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: summing on character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334240#M75483</link>
      <description>&lt;P&gt;Nice and easy with PROC SQL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID, Country, count(*) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; numberofoccurence&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;group&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID, Country;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 02:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334240#M75483</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-02-20T02:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: summing on character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334244#M75484</link>
      <description>&lt;P&gt;Or this? proc freq data=have noprint; tables id*country / out=want(drop=percent rename=count=numberofoccurence); run;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 03:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334244#M75484</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2017-02-20T03:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: summing on character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334246#M75485</link>
      <description>&lt;P&gt;You aren't summing you're counting the number of occurrences by a categorical variable. I'm only clarifying the term so that you can search for valid solutions. Key word searches requires the correct key words and are primarily designed for English speakers.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 03:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334246#M75485</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-20T03:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: summing on character variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334261#M75493</link>
      <description>&lt;P&gt;Thank you all very much for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 05:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summing-on-character-variables/m-p/334261#M75493</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2017-02-20T05:36:36Z</dc:date>
    </item>
  </channel>
</rss>

