<?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 Summarizing Geographical Data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591947#M76018</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help summarizing a relatively small dataset by the state code that is in the data. I have locations both inside and outside of the U.S. and I'd like to summarize this so that I can see how many records are in the U.S. and how many are in different countries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;STATE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;FC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;GB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;FL&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to have something output that shows the state and the frequency, but ONLY if the frequency is over 25.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I'd like to have it grouped by in U.S. vs. Outside of U.S. Is there a way to do this without individually calling out every state/territory in a data step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 18:28:37 GMT</pubDate>
    <dc:creator>Sas_noob25</dc:creator>
    <dc:date>2019-09-26T18:28:37Z</dc:date>
    <item>
      <title>Summarizing Geographical Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591947#M76018</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help summarizing a relatively small dataset by the state code that is in the data. I have locations both inside and outside of the U.S. and I'd like to summarize this so that I can see how many records are in the U.S. and how many are in different countries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;STATE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;FC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;GB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;FL&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to have something output that shows the state and the frequency, but ONLY if the frequency is over 25.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I'd like to have it grouped by in U.S. vs. Outside of U.S. Is there a way to do this without individually calling out every state/territory in a data step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591947#M76018</guid>
      <dc:creator>Sas_noob25</dc:creator>
      <dc:date>2019-09-26T18:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing Geographical Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591962#M76019</link>
      <description>&lt;P&gt;PROC FREQ with FORMAT. &lt;BR /&gt;Create a user format that maps each state to US and everything else to a different code. Then when you do the PROC FREQ you can apply that format and have it displayed as desired. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_format_example.sas" target="_blank" rel="noopener"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/proc_format_example.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: If you're having trouble creating the look up table, SASHELP/SASMAPS or MAPSGSFK may have the data you need and you can create a format from one of those data sets.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591962#M76019</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-26T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing Geographical Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591966#M76020</link>
      <description>&lt;P&gt;Create a format to define which states are internal and which external:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
    value $statetyp
       'CA' = 'EX'
       'FC' = 'US'
       'GB' = 'EX'
      ...  /* correct mistakes */
      otherwise = 'er'  /* as error to be checked */
; run;   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then summarize using the format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have;
   class state;
   format state statetyp. ;
   var &amp;lt;list of variables to sum&amp;gt; ;
   output out=want sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summarizing-Geographical-Data/m-p/591966#M76020</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-09-26T18:58:11Z</dc:date>
    </item>
  </channel>
</rss>

