<?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: Why I get different answers for intck year and yr dif? Both shouldn't be giving the same answers in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846423#M36884</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
input pid bdate: date9. svdate: date9.;
format bdate svdate date9.;

days=intck('day',bdate,svdate,'c');
months=intck('month',bdate,svdate,'c');
years=intck('year',bdate,svdate,'c');
usingyrdiff= int(yrdif(bdate, svdate, 'actual'));  
cards;
101 19mar1978 14feb2005
102 20may1975 19mar2006
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 26 Nov 2022 16:34:53 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-11-26T16:34:53Z</dc:date>
    <item>
      <title>Why I get different answers for intck year and yr dif? Both shouldn't be giving the same answers?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846420#M36882</link>
      <description>&lt;PRE&gt;data demo;
input pid bdate: date9. svdate: date9.;
format bdate svdate date9.;

days=intck('day',bdate,svdate);
months=intck('month',bdate,svdate);
years=intck('year',bdate,svdate);
usingyrdiff= int(yrdif(bdate, svdate, 'actual'));  
cards;
101 19mar1978 14feb2005
102 20may1975 19mar2006
;
run;
proc print data=demo;
run;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Intck yr vs yrdiff.png" style="width: 635px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77731i366FD86FB62A9A09/image-size/large?v=v2&amp;amp;px=999" role="button" title="Intck yr vs yrdiff.png" alt="Intck yr vs yrdiff.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 16:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846420#M36882</guid>
      <dc:creator>POOJA_J</dc:creator>
      <dc:date>2022-11-26T16:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get different answers for intck year and yr dif? Both shouldn't be giving the same answers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846422#M36883</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Take a look at this blog article. I think it explains your experience with INTCK &lt;A href="https://blogs.sas.com/content/iml/2017/05/15/intck-intnx-intervals-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/05/15/intck-intnx-intervals-sas.html&lt;/A&gt; . Basically, INTCK returns the number of "boundary dates" that have passed. So you need to control for that. There are also some good references at the end of the article.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 16:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846422#M36883</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-11-26T16:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get different answers for intck year and yr dif? Both shouldn't be giving the same answers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846423#M36884</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
input pid bdate: date9. svdate: date9.;
format bdate svdate date9.;

days=intck('day',bdate,svdate,'c');
months=intck('month',bdate,svdate,'c');
years=intck('year',bdate,svdate,'c');
usingyrdiff= int(yrdif(bdate, svdate, 'actual'));  
cards;
101 19mar1978 14feb2005
102 20may1975 19mar2006
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Nov 2022 16:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846423#M36884</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-26T16:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get different answers for intck year and yr dif? Both shouldn't be giving the same answers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846424#M36885</link>
      <description>&lt;P&gt;In its default setting, INTCK counts the&amp;nbsp;&lt;EM&gt;number of interval&amp;nbsp;&lt;U&gt;boundaries&lt;/U&gt;&lt;/EM&gt; between the values. Somebody born on December 31 will be one year old on January 1. To avoid this, you must use the "c" (continuous) modifier.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 16:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-I-get-different-answers-for-intck-year-and-yr-dif-Both/m-p/846424#M36885</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-26T16:48:24Z</dc:date>
    </item>
  </channel>
</rss>

