<?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: find out maximum day from dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362534#M85657</link>
    <description>Thanks for your help.</description>
    <pubDate>Mon, 29 May 2017 16:10:14 GMT</pubDate>
    <dc:creator>amit123_silwal</dc:creator>
    <dc:date>2017-05-29T16:10:14Z</dc:date>
    <item>
      <title>find out maximum day from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362523#M85653</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My name is Amit, I am new to SAS.I am using SAS9.3. I have a data set which contains data about crimes. I would like to find out on which day of the week the maximum crime occurred. For this I have tried the code below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data=work.crime;&lt;BR /&gt;tables DayOfWeek;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code gives me the frequency for each day and I can decide from the frequency ,on which day the maximum crime occured. I would like to know if this is the correct way or not.If not, kindly help me in writing the required code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Amit B.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 15:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362523#M85653</guid>
      <dc:creator>amit123_silwal</dc:creator>
      <dc:date>2017-05-29T15:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: find out maximum day from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362526#M85654</link>
      <description>&lt;P&gt;This is a valid way to find what you wanted. Consider expanding your proc freq by writing to an output dataset, and sorting that by descending count&lt;/P&gt;
&lt;P&gt;Another way would be SQL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
  select dayofweek, count(*) as number
  from work.crime
  group by dayofweek
  order by number descending
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 May 2017 15:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362526#M85654</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-29T15:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: find out maximum day from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362528#M85655</link>
      <description>Thank you very much for your help. Really appreciated.</description>
      <pubDate>Mon, 29 May 2017 15:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362528#M85655</guid>
      <dc:creator>amit123_silwal</dc:creator>
      <dc:date>2017-05-29T15:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: find out maximum day from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362533#M85656</link>
      <description>&lt;P&gt;There's another way you may use PROC FREQ to have highest frequency on top, rather than manually looking into the results to find one, not that using PROC SQL is wrong or anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data=work.crime &lt;STRONG&gt;order=freq&lt;/STRONG&gt;;&lt;BR /&gt;tables DayOfWeek;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ORDER=FREQ option would allow you see the results in descending order of frerquency.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 16:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362533#M85656</guid>
      <dc:creator>Arpit_Agarwal</dc:creator>
      <dc:date>2017-05-29T16:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: find out maximum day from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362534#M85657</link>
      <description>Thanks for your help.</description>
      <pubDate>Mon, 29 May 2017 16:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-out-maximum-day-from-dataset/m-p/362534#M85657</guid>
      <dc:creator>amit123_silwal</dc:creator>
      <dc:date>2017-05-29T16:10:14Z</dc:date>
    </item>
  </channel>
</rss>

