<?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: Counting records in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80281#M256606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have created a table or dataset with the counts per association I would normally use procs format and freq.&lt;/P&gt;&lt;P&gt;Instead of modifying query add as one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format library=work;&lt;/P&gt;&lt;P&gt;value members&lt;/P&gt;&lt;P&gt;0 - 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = '&amp;nbsp;&amp;nbsp; 0 - 100 members'&lt;/P&gt;&lt;P&gt;101 - 500&amp;nbsp; = ' 101 - 500 members'&lt;BR /&gt;501 - 1000 = ' 501 - 1000 members'&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1001 - 5000 = '1001 - 5000 members&lt;/P&gt;&lt;P&gt;5001 - high = '5001 or more members'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/*assuming MemberCount holds the sum of members for each association, use your variable name*/&lt;/P&gt;&lt;P&gt;proc freq data=&amp;lt;your data set name&amp;gt;;&lt;/P&gt;&lt;P&gt;table MemberCount ;&lt;/P&gt;&lt;P&gt;format MemberCount members.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jul 2012 21:22:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-07-31T21:22:11Z</dc:date>
    <item>
      <title>Counting records in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80280#M256605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone...sorry for the simplistic question, but I am a brand new (and I do mean new!) user to SAS. Just trying to pull some data and create an output showing number of records in each category. Example of data to be pulled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Activity Date&lt;/P&gt;&lt;P&gt;Line of Business&lt;/P&gt;&lt;P&gt;Physician Association&lt;/P&gt;&lt;P&gt;Member Count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I retrieve the data and sum by Member Count for each Physician Association, I then need to know how many of those Physician Associations fall under the following categories:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0 - 100 members&lt;/P&gt;&lt;P&gt;101 - 500 members&lt;/P&gt;&lt;P&gt;501 - 1000 members&lt;/P&gt;&lt;P&gt;1001 - 5000 members&lt;/P&gt;&lt;P&gt;5001 or greater&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a simple way to modify the query to accomplish this task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike &lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 20:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80280#M256605</guid>
      <dc:creator>mbenedet</dc:creator>
      <dc:date>2012-07-31T20:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Counting records in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80281#M256606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have created a table or dataset with the counts per association I would normally use procs format and freq.&lt;/P&gt;&lt;P&gt;Instead of modifying query add as one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format library=work;&lt;/P&gt;&lt;P&gt;value members&lt;/P&gt;&lt;P&gt;0 - 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = '&amp;nbsp;&amp;nbsp; 0 - 100 members'&lt;/P&gt;&lt;P&gt;101 - 500&amp;nbsp; = ' 101 - 500 members'&lt;BR /&gt;501 - 1000 = ' 501 - 1000 members'&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1001 - 5000 = '1001 - 5000 members&lt;/P&gt;&lt;P&gt;5001 - high = '5001 or more members'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/*assuming MemberCount holds the sum of members for each association, use your variable name*/&lt;/P&gt;&lt;P&gt;proc freq data=&amp;lt;your data set name&amp;gt;;&lt;/P&gt;&lt;P&gt;table MemberCount ;&lt;/P&gt;&lt;P&gt;format MemberCount members.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 21:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80281#M256606</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-07-31T21:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Counting records in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80282#M256607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply. I copied the code and pasted below for what I have so far and all it does is group the data by Physician Association with their total member count. Are you saying I should add all of the code in your reply (starting with proc format library=work; to the end run; statement) to the bottom of my code to make it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;_eg_conditional_dropds&lt;/EM&gt;&lt;/STRONG&gt;(WORK.QUERY950);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;PROC&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; WORK.QUERY950 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; SF_PROF_MEMBERDATA_201206.activity_date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_PROF_MEMBERDATA_201206.master_ipa,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_PROF_MEMBERDATA_201206.sf_lob &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; SERVFUND.SF_PROF_MEMBERDATA_201206 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; SF_PROF_MEMBERDATA_201206&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;GROUP &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; SF_PROF_MEMBERDATA_201206.activity_date, SF_PROF_MEMBERDATA_201206.master_ipa, SF_PROF_MEMBERDATA_201206.sf_lob;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;QUIT&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 12:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-records-in-SAS/m-p/80282#M256607</guid>
      <dc:creator>mbenedet</dc:creator>
      <dc:date>2012-08-01T12:54:37Z</dc:date>
    </item>
  </channel>
</rss>

