<?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 difference (in days) between 2 days in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479585#M123828</link>
    <description>&lt;P&gt;If they get converted to a date in 1960, then you are using a datetime function on them, this won't get you the desired results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find the difference between two dates, subtract them.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 17:17:43 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-07-19T17:17:43Z</dc:date>
    <item>
      <title>Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479578#M123827</link>
      <description>&lt;P&gt;I'm trying to find the difference in dates of the format 01DEC2017... when I'm pulling in these dates they suddenly get converted to dates in the 1960's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I pull these dates in and not change these dates? also how can I find the difference in dates of this format? thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479578#M123827</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T17:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479585#M123828</link>
      <description>&lt;P&gt;If they get converted to a date in 1960, then you are using a datetime function on them, this won't get you the desired results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find the difference between two dates, subtract them.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479585#M123828</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-19T17:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479595#M123830</link>
      <description>&lt;P&gt;You likely have datetime variables not dates. Use DATEPART() to get the date portions or use INTCK to find the intervals.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218524"&gt;@toesockshoe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to find the difference in dates of the format 01DEC2017... when I'm pulling in these dates they suddenly get converted to dates in the 1960's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I pull these dates in and not change these dates? also how can I find the difference in dates of this format? thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479595#M123830</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T17:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479605#M123832</link>
      <description>&lt;P&gt;I checked and it is of date9. format.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479605#M123832</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T17:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479612#M123833</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218524"&gt;@toesockshoe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to find the difference in dates of the format 01DEC2017... when I'm pulling in these dates they suddenly get converted to dates in the 1960's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I pull these dates in and not change these dates? also how can I find the difference in dates of this format? thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the code for how you are "pulling in these dates".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479612#M123833</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-19T17:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479613#M123834</link>
      <description>&lt;P&gt;in the select statement (using proc SQL) I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;RWS.DATE &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; birthdate format = &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479613#M123834</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T18:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479614#M123835</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218524"&gt;@toesockshoe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to find the difference in dates of the format 01DEC2017... when I'm pulling in these dates they suddenly get converted to dates in the 1960's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I pull these dates in and not change these dates? also how can I find the difference in dates of this format? thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the code for how you are "pulling in these dates".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And show us a portion of the data too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do the subtraction, and you find out, for example that the difference between two dates is 22 days, and you format this difference as DATE9., you will get a date in 1960. You don't want this difference formatted.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479614#M123835</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-19T18:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479618#M123836</link>
      <description>&lt;P&gt;so when I'm pulling in the dates (just pulling....not subtracting) the dates change from dates in the 2017 range to the 1960 range.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how the data looks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;RWS.DATE is 30OCT2007&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;then I pull it to create a new table using the statement in the above comment and it just changes to a date in the 1960's.... is that what you were asking for?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479618#M123836</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T18:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479621#M123837</link>
      <description>&lt;P&gt;Post a reproducible example of your problem then please.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218524"&gt;@toesockshoe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I checked and it is of date9. format.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479621#M123837</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T18:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479622#M123838</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218524"&gt;@toesockshoe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;so when I'm pulling in the dates (just pulling....not subtracting) the dates change from dates in the 2017 range to the 1960 range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how the data looks:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;RWS.DATE is 30OCT2007&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;then I pull it to create a new table using the statement in the above comment and it just changes to a date in the 1960's.... is that what you were asking for?&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't format the difference. It is an integer. If you don't format the difference, it looks like an integer, such as 22. If you format the difference it looks like a date in 1960.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479622#M123838</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-19T18:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479626#M123839</link>
      <description>&lt;P&gt;ok so heres how I'm pulling stuff in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table new as&lt;/P&gt;&lt;P&gt;&amp;nbsp;select A.DATE as birthdate format = date9.&lt;/P&gt;&lt;P&gt;from rws.people A;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;table A's DATE column looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20AUG2012&lt;BR /&gt;22MAR2015&lt;BR /&gt;01JUN2002&lt;BR /&gt;13MAR2004&lt;BR /&gt;02SEP2005&lt;BR /&gt;03AUG2012&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the outputted birthday column looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;04APR1962&lt;BR /&gt;13NOV1960&lt;BR /&gt;05FEB1963&lt;BR /&gt;17OCT1961&lt;BR /&gt;10OCT1962&lt;BR /&gt;21OCT1962&lt;BR /&gt;25DEC1963&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479626#M123839</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T18:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479628#M123840</link>
      <description>&lt;P&gt;I'm not formatting any difference..... I'm just pulling in the data from one dataset to another... the difference part will come later once I figure out how to pull the data correctly&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479628#M123840</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T18:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479653#M123846</link>
      <description>&lt;P&gt;Ok, time to stop guessing. Please post your full code and sample input and/or proc contents on your data set after retrieval.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218524"&gt;@toesockshoe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm not formatting any difference..... I'm just pulling in the data from one dataset to another... the difference part will come later once I figure out how to pull the data correctly&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 19:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479653#M123846</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T19:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find difference (in days) between 2 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479690#M123850</link>
      <description>&lt;P&gt;whoops sorry... I made a dumb dumb mistake.... I realized I was calling the wrong variable&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 20:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-difference-in-days-between-2-days/m-p/479690#M123850</guid>
      <dc:creator>toesockshoe</dc:creator>
      <dc:date>2018-07-19T20:31:56Z</dc:date>
    </item>
  </channel>
</rss>

