<?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 Having count in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343784#M63436</link>
    <description>&lt;P&gt;I want to eliminate the variable having less than 36 observations This is my program but it does not work&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt; create table fundno_limit as&lt;BR /&gt; select *&lt;BR /&gt; from joint_data&lt;BR /&gt; where mret is not null&lt;BR /&gt;group by rank_no&lt;BR /&gt; Having count(mret)&amp;gt;=36&lt;BR /&gt; order by rankdate and rank_no;&lt;BR /&gt; quit;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 17:23:32 GMT</pubDate>
    <dc:creator>sasphd</dc:creator>
    <dc:date>2017-03-23T17:23:32Z</dc:date>
    <item>
      <title>Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343784#M63436</link>
      <description>&lt;P&gt;I want to eliminate the variable having less than 36 observations This is my program but it does not work&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt; create table fundno_limit as&lt;BR /&gt; select *&lt;BR /&gt; from joint_data&lt;BR /&gt; where mret is not null&lt;BR /&gt;group by rank_no&lt;BR /&gt; Having count(mret)&amp;gt;=36&lt;BR /&gt; order by rankdate and rank_no;&lt;BR /&gt; quit;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343784#M63436</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2017-03-23T17:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343791#M63438</link>
      <description>&lt;P&gt;There may be more changes needed, but you could start with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;order by rankdate, rank_no;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343791#M63438</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-23T17:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343795#M63439</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;/P&gt;
&lt;P&gt;Are there errors in the log: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;/P&gt;
&lt;P&gt;No output? Post any log in a code box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unexpected output? Provide input data in the form of a dataset, the actual&amp;nbsp;results and the expected results. Data should be in the form of a data step. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Lib&lt;WBR /&gt;rary/How-to-create-a-data-step-version-of-your-dat&lt;WBR /&gt;...&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343795#M63439</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-23T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343800#M63440</link>
      <description>&lt;P&gt;no there is not an error in the log.&lt;/P&gt;
&lt;P&gt;However I did not succed to join database I can not find&amp;nbsp;&lt;STRONG&gt; myfolders folder and&amp;nbsp;Edit the AutoExec file to add the program to your autoexec&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;it is really a trouble for me&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;. can explain for me haw to add data to this forum................&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343800#M63440</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2017-03-23T17:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343804#M63441</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4327"&gt;@sasphd&lt;/a&gt;&amp;nbsp;I'll be happy to walk you through the instructions. They're currently numbered steps, which step are you having issue with?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343804#M63441</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-23T18:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343808#M63442</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 2 I can not find myfolders folders to place the file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. &lt;STRONG&gt;Download the zip file from Mark's blog:&amp;nbsp;&lt;A href="http://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://blogs.sas.com/content/sastraining/2016/03/1&lt;WBR /&gt;1/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;2. &lt;STRONG&gt;Extract the zip file and place the data2datastep.sas program into your myfolders folder set up.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2447iB598DF71F5AE6F12/image-size/medium?v=1.0&amp;amp;px=400" border="0" alt="Screen Shot 2016-03-23 at 8.03.29 PM.png" title="Screen Shot 2016-03-23 at 8.03.29 PM.png" /&gt;&lt;/P&gt;
&lt;P&gt;3. &lt;STRONG&gt;In SAS University Edition, go to the Edit the AutoExec file to add the program to your autoexec&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2448i4324B8938F1AE178/image-size/medium?v=1.0&amp;amp;px=400" border="0" alt="Screen Shot 2016-03-23 at 8.04.29 PM.png" title="Screen Shot 2016-03-23 at 8.04.29 PM.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. &lt;STRONG&gt;In the Autoexec, add the reference to the program, and RUN, then SAVE.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macrostatement"&gt;%include&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'/folders/myfolders/data2datastep.sas'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;lrecl&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2449iF87A4CD117D65E6A/image-size/medium?v=1.0&amp;amp;px=400" border="0" alt="Screen Shot 2016-03-23 at 8.04.44 PM.png" title="Screen Shot 2016-03-23 at 8.04.44 PM.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5. &lt;STRONG&gt;Test the code in SAS UE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macroname"&gt;%data2datastep&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;cars&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;sashelp&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;5&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;6. &lt;STRONG&gt;A file is generated called create_sashelp_CARS_data.sas&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343808#M63442</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2017-03-23T18:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343810#M63443</link>
      <description>&lt;P&gt;When you set up SAS UE you set up a folder called myfolders? This assumes you're using SAS UE, if not these instructions don't apply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't remember where you set up myfolders, open VirtualBox, go to the shared folders setting and find the path. &amp;nbsp;That's where you can place the file. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AS A LAST RESORT&lt;/P&gt;
&lt;P&gt;If you absolutely cannot figure out the location, paste the full macro code into your autoexec program itself and DON'T include the %INCLUDE statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR paste the macro program into a SAS UE window, run the code and then skip to step 5.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually you'll still need to find where myfolders is set up so that you find the file with the data step code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/343810#M63443</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-23T18:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/344121#M63469</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What do you mean by &lt;STRONG&gt;paste the full macro code into your autoexec program itself and DON'T include the %INCLUDE statement.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;is this the macro&lt;/P&gt;
&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macrostatement"&gt;%include&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'/folders/myfolders/data2datastep.sas'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;lrecl&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;My problem is that I have SAS 9.4 from my university so I did not succedd to find all folders you demand&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 16:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/344121#M63469</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2017-03-24T16:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Having count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/344127#M63470</link>
      <description>&lt;P&gt;Save the SAS program to a known location then and in your %INCLUDE change the path to wherever you saved the file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 16:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-count/m-p/344127#M63470</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-24T16:54:11Z</dc:date>
    </item>
  </channel>
</rss>

