<?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: Max n Min of Dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295975#M61922</link>
    <description>&lt;P&gt;As you probably guessed, since ID is character you would not store a count in ID.&amp;nbsp; If you plan on programming using SQL, you could use something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;count(ID) as n_hospital_visits&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see hospital in the data either, though.&amp;nbsp; You may need to update your description of the data.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 19:16:41 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-09-01T19:16:41Z</dc:date>
    <item>
      <title>Max n Min of Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295343#M61712</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to create a report which has the Maximum/Minimum of Unique-ids a Patient visited had on any day within 2015-16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My table looks like this.&lt;/P&gt;&lt;P&gt;Datatypes:--- ID Char&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year Number,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month Number,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day Number,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; product Char,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; First visit date Timestamp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product Year Month Day Count(ID) as ID&lt;/P&gt;&lt;P&gt;216ABCE 2015 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;ASSDE&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;uJKILEY&amp;nbsp;&amp;nbsp; 2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;216ABCE 2015 9 &amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;ASSDE&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015&amp;nbsp; 9 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 1&lt;/P&gt;&lt;P&gt;uJKILEY&amp;nbsp;&amp;nbsp; 2016&amp;nbsp; 9 &amp;nbsp;&amp;nbsp; 20 &amp;nbsp; 709&lt;/P&gt;&lt;P&gt;Please suggest.&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;</description>
      <pubDate>Tue, 30 Aug 2016 22:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295343#M61712</guid>
      <dc:creator>santosh_pat69</dc:creator>
      <dc:date>2016-08-30T22:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Max n Min of Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295345#M61713</link>
      <description>&lt;P&gt;Suggestions to get started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, combine the month, day, and year:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sasdate = mdy(month, day, year);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will make the coding easier to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, add PATIENT to your data set. &amp;nbsp;It's really not possible to perform calculations based on PATIENT when it is not even part of your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third, why would you replace ID with COUNT(ID)? &amp;nbsp;Wouldn't that make the report confusing?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 22:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295345#M61713</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-30T22:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Max n Min of Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295974#M61921</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick reply,&lt;/P&gt;&lt;P&gt;I have used the count(ID) as i need to get the max and min of the number of times a patient has visited the hospital.&lt;/P&gt;&lt;P&gt;The data type of ID is char,&lt;/P&gt;&lt;P&gt;Kindly suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are looking for the minimum&amp;nbsp; &amp;amp; Maximum number of times a patient has visited based on the Patient ID.&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;</description>
      <pubDate>Thu, 01 Sep 2016 19:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295974#M61921</guid>
      <dc:creator>santosh_pat69</dc:creator>
      <dc:date>2016-09-01T19:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Max n Min of Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295975#M61922</link>
      <description>&lt;P&gt;As you probably guessed, since ID is character you would not store a count in ID.&amp;nbsp; If you plan on programming using SQL, you could use something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;count(ID) as n_hospital_visits&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see hospital in the data either, though.&amp;nbsp; You may need to update your description of the data.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 19:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-n-Min-of-Dates/m-p/295975#M61922</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-01T19:16:41Z</dc:date>
    </item>
  </channel>
</rss>

