<?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 Invalid argument to function YRDIF in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-YRDIF/m-p/264020#M51724</link>
    <description>&lt;P&gt;I'm trying to calculate the difference in years between two dates using the YRDIF function and the following syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
  SET have;
  Yrdif_test = YRDIF(Part_RDATE, BH_Accomplished_Date, "Actual");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I am getting an "invalid argument"&amp;nbsp;warning and all the values are missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The informats for these two dates are different.&lt;/P&gt;
&lt;P&gt;Part_RDATE =&amp;nbsp;mmddyy10&lt;/P&gt;
&lt;P&gt;BH_Accomplished_Date=mdyampm25.2 (includes time)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation makes no reference to differences in informats, or dates where one includes time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A portion of the data is attached. As is the log. Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 21:42:32 GMT</pubDate>
    <dc:creator>_maldini_</dc:creator>
    <dc:date>2016-04-14T21:42:32Z</dc:date>
    <item>
      <title>Invalid argument to function YRDIF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-YRDIF/m-p/264020#M51724</link>
      <description>&lt;P&gt;I'm trying to calculate the difference in years between two dates using the YRDIF function and the following syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
  SET have;
  Yrdif_test = YRDIF(Part_RDATE, BH_Accomplished_Date, "Actual");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I am getting an "invalid argument"&amp;nbsp;warning and all the values are missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The informats for these two dates are different.&lt;/P&gt;
&lt;P&gt;Part_RDATE =&amp;nbsp;mmddyy10&lt;/P&gt;
&lt;P&gt;BH_Accomplished_Date=mdyampm25.2 (includes time)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation makes no reference to differences in informats, or dates where one includes time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A portion of the data is attached. As is the log. Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-YRDIF/m-p/264020#M51724</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2016-04-14T21:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function YRDIF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-YRDIF/m-p/264026#M51727</link>
      <description>&lt;P&gt;The documentation states that both start and end dates are both SAS date values not datetime. This should correct your statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
  SET have;
  Yrdif_test = YRDIF(Part_RDATE, datepart(BH_Accomplished_Date), "Actual");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function-YRDIF/m-p/264026#M51727</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-04-14T22:01:20Z</dc:date>
    </item>
  </channel>
</rss>

