<?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 DATDIF/YRDIF functions in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/DATDIF-YRDIF-functions/m-p/701559#M25773</link>
    <description>&lt;PRE&gt;data scoredata1;&lt;BR /&gt;set scoredata0;&lt;BR /&gt;year_diff1 = YRDIF(start_date,today(),'30/360');&lt;BR /&gt;year_diff2 = YRDIF(start_date,'14sep2015'd,'ACT/ACT');&lt;BR /&gt;year_diff3 = YRDIF(start_date,today(),'ACT/360');&lt;BR /&gt;year_diff4 = YRDIF(start_date,'14sep2015'd,'ACT/365');&lt;BR /&gt;&lt;BR /&gt;day_diff1 = datDIF(start_date,today(),'30/360');&lt;BR /&gt;day_diff2 = datDIF(start_date,'14sep2015'd,'ACT/ACT');&lt;BR /&gt;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;when I run the codes above, I got different values due to different bases. How can I sue these values? or what are the significance of these differences?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, why should we put 'd' after the date in date9 format?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 15:38:51 GMT</pubDate>
    <dc:creator>anming</dc:creator>
    <dc:date>2020-11-25T15:38:51Z</dc:date>
    <item>
      <title>DATDIF/YRDIF functions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/DATDIF-YRDIF-functions/m-p/701559#M25773</link>
      <description>&lt;PRE&gt;data scoredata1;&lt;BR /&gt;set scoredata0;&lt;BR /&gt;year_diff1 = YRDIF(start_date,today(),'30/360');&lt;BR /&gt;year_diff2 = YRDIF(start_date,'14sep2015'd,'ACT/ACT');&lt;BR /&gt;year_diff3 = YRDIF(start_date,today(),'ACT/360');&lt;BR /&gt;year_diff4 = YRDIF(start_date,'14sep2015'd,'ACT/365');&lt;BR /&gt;&lt;BR /&gt;day_diff1 = datDIF(start_date,today(),'30/360');&lt;BR /&gt;day_diff2 = datDIF(start_date,'14sep2015'd,'ACT/ACT');&lt;BR /&gt;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;when I run the codes above, I got different values due to different bases. How can I sue these values? or what are the significance of these differences?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, why should we put 'd' after the date in date9 format?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/DATDIF-YRDIF-functions/m-p/701559#M25773</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-11-25T15:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: DATDIF/YRDIF functions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/DATDIF-YRDIF-functions/m-p/701561#M25774</link>
      <description>&lt;P&gt;The documentation explains the differences&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p1pmmr2dtec32an1vbsqmm3abil5.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p1pmmr2dtec32an1vbsqmm3abil5.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;why should we put 'd' after the date in date9 format?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Formats are irrelevant, SAS does all calculations based upon the internal representation of the dates, which is the integer number of days since 01JAN1960. So whether the date is formatted or not, that's how it is represented. So when you use&amp;nbsp;'14sep2015'd, the d at the end tells SAS to convert the date to the integer number of days since 01JAN1960, and now the math proceeds properly. If you leave of the d at the end, then SAS is trying to work with a character string&amp;nbsp;'14sep2015' which is not a date and can't be evaluated in date arithmetic.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/DATDIF-YRDIF-functions/m-p/701561#M25774</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-25T15:48:00Z</dc:date>
    </item>
  </channel>
</rss>

