<?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 how to count days between two variables (negative and positive) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321979#M71166</link>
    <description>&lt;P&gt;i have two variables&lt;/P&gt;
&lt;P&gt;date1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; date2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;diff (date2-date1)&lt;/P&gt;
&lt;P&gt;20080101 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;20080104 &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;20080101 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;20071230 &amp;nbsp; &amp;nbsp; &amp;nbsp;-2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;how do i calculate the difference date2-date1 as above? i wanted to know how many days over and under date2 is vs date1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thank you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jan 2017 17:48:41 GMT</pubDate>
    <dc:creator>aarony</dc:creator>
    <dc:date>2017-01-02T17:48:41Z</dc:date>
    <item>
      <title>how to count days between two variables (negative and positive)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321979#M71166</link>
      <description>&lt;P&gt;i have two variables&lt;/P&gt;
&lt;P&gt;date1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; date2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;diff (date2-date1)&lt;/P&gt;
&lt;P&gt;20080101 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;20080104 &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;20080101 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;20071230 &amp;nbsp; &amp;nbsp; &amp;nbsp;-2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;how do i calculate the difference date2-date1 as above? i wanted to know how many days over and under date2 is vs date1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thank you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 17:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321979#M71166</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2017-01-02T17:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to count days between two variables (negative and positive)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321981#M71168</link>
      <description>Hi, I you run PROC CONTENTS on DATE1 and DATE2, are they character variables or are they SAS date variables? The method you use to calculate the difference will be easy, once the dates are stored as SAS date values (the number of days since Jan 1, 1960.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Mon, 02 Jan 2017 17:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321981#M71168</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-02T17:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to count days between two variables (negative and positive)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321982#M71169</link>
      <description>Hi Cynthia. They are date variables.&lt;BR /&gt;Thanks for your reply.&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jan 2017 17:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321982#M71169</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2017-01-02T17:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to count days between two variables (negative and positive)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321996#M71175</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If they are SAS date variables, you can just subtract them and then, if you want to get the absolute value, without a negative sign (since depending on your 2 numbers, you might get a negative DIFF), then you can just use the ABS function.&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6559i29566090EDD064D4/image-size/original?v=v2&amp;amp;px=-1" alt="diff_days.png" title="diff_days.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 18:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-count-days-between-two-variables-negative-and-positive/m-p/321996#M71175</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-02T18:47:55Z</dc:date>
    </item>
  </channel>
</rss>

