<?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 Average between two date column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348195#M80604</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;two date columns namely accept_date and issue_date.&lt;/P&gt;&lt;P&gt;Both are numeric and in format 08MAR2008.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to find average between accept_date and issue_date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Vishyy&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 16:27:13 GMT</pubDate>
    <dc:creator>vishyy</dc:creator>
    <dc:date>2017-04-07T16:27:13Z</dc:date>
    <item>
      <title>Average between two date column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348195#M80604</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;two date columns namely accept_date and issue_date.&lt;/P&gt;&lt;P&gt;Both are numeric and in format 08MAR2008.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to find average between accept_date and issue_date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Vishyy&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 16:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348195#M80604</guid>
      <dc:creator>vishyy</dc:creator>
      <dc:date>2017-04-07T16:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Average between two date column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348205#M80608</link>
      <description>&lt;P&gt;You may want to clarify this a bit. The average is likely to have a fractional component. How do you want that treated?&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data _null_;
   meandate = mean('01FEB2017'd,'02FEB2017'd);
   put meandate  meandate= date9. ;
run;&lt;/PRE&gt;
&lt;P&gt;In terms of a format the date would get rounded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So do you want an integer date value for the mean or what?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348205#M80608</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-07T17:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Average between two date column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348208#M80610</link>
      <description>&lt;P&gt;I need the difference between these two dates and then the average.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348208#M80610</guid>
      <dc:creator>vishyy</dc:creator>
      <dc:date>2017-04-07T17:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Average between two date column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348239#M80616</link>
      <description>&lt;P&gt;average can be done with the mean function as in my previous example. Just put your variables in place of the values.&lt;/P&gt;
&lt;P&gt;Difference may require more information. Is one date always after the other and you want the later minus the earlier? Of is there more of a rule involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;difference = accept_date - issue_date;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is one way.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348239#M80616</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-07T18:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Average between two date column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348246#M80618</link>
      <description>&lt;P&gt;1. Find the difference for every record.&lt;/P&gt;
&lt;P&gt;2. Compute the average the distance variable created from step 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You haven't provided any data so we can't say how this should be coded. There have been some suggestions but they're based on experience and guesses at this point.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348246#M80618</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-07T18:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Average between two date column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348275#M80625</link>
      <description>&lt;P&gt;One possibility:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;days_between = issue_date - accept_date;&amp;nbsp;&amp;nbsp; /* may need to reverse this */&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=want;&lt;/P&gt;
&lt;P&gt;var days_between;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part of the answer depends on what you mean when you say "find" the average.&amp;nbsp; This program gives you a report with the average.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 19:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-between-two-date-column/m-p/348275#M80625</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-07T19:24:34Z</dc:date>
    </item>
  </channel>
</rss>

