<?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: Using the intnx function correctly? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424113#M104391</link>
    <description>&lt;P&gt;I think it sounds like you need the days interval and not the increment of intervals if I understand you correctly. You would probably need to look at I&lt;STRONG&gt;ntck function &lt;/STRONG&gt;instead of&lt;STRONG&gt; intnx&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Dec 2017 16:43:24 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2017-12-30T16:43:24Z</dc:date>
    <item>
      <title>Using the intnx function correctly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424112#M104390</link>
      <description>&lt;P&gt;I am trying to&amp;nbsp;get individuals that have continuous eligibility +/- 1 year before an index_dt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two datasets I'm merging are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;compiled_ip_index which contains enrolid-year combinations and a corresponding index_dt&lt;/LI&gt;&lt;LI&gt;ce_merged_1014 which contains enrolid and continuous enrollment start date and end date&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My current code is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 

create table final_elig_ip as 
select a.*, b.*
from compiled_ip_index as a
inner join summary.ce_merged_1014 as b
on a.enrolid = b.enrolid and a.year = b.year and intnx ('day', b.enroll_start_dt, a.index_dt)&amp;gt;=365 and intnx ('day', a.index_dt, b.enroll_end_dt)&amp;gt;=365;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But this ends up yielding a final_elig_ip where index date is often within 365 days of the enrollment start date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What went wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2017 16:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424112#M104390</guid>
      <dc:creator>cdubs</dc:creator>
      <dc:date>2017-12-30T16:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using the intnx function correctly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424113#M104391</link>
      <description>&lt;P&gt;I think it sounds like you need the days interval and not the increment of intervals if I understand you correctly. You would probably need to look at I&lt;STRONG&gt;ntck function &lt;/STRONG&gt;instead of&lt;STRONG&gt; intnx&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2017 16:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424113#M104391</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-30T16:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using the intnx function correctly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424115#M104393</link>
      <description>&lt;P&gt;Question about your specs. You said "&lt;SPAN&gt;I am trying to&amp;nbsp;get individuals that have continuous eligibility +/- 1 year before an index_dt.&amp;nbsp;&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "+/- 1 year before" raises a question. Do you mean "at least one year before or after" or something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean one year before or after, then why not simply use:&lt;/P&gt;
&lt;PRE&gt;abs(b.enroll_start_dt-a.index_dt)&amp;gt;=365&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2017 19:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424115#M104393</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-12-30T19:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using the intnx function correctly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424117#M104394</link>
      <description>&lt;P&gt;INTNX returns a date the specified intervals, ie date at which you turn 30&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INTCK returns the intervals between two dates, ie number of days, months or years between two dates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dates are also numeric so you so you can subtract them. Be specific in your definitions though, 365 days is not the same as a year or 12 months.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2017 20:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424117#M104394</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-30T20:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using the intnx function correctly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424125#M104396</link>
      <description>&lt;P&gt;I think what you need is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
create table final_elig_ip as 
select 
    a.*, 
    b.*
from 
    compiled_ip_index as a inner join 
    summary.ce_merged_1014 as b
    on 
        a.enrolid = b.enrolid and 
        a.year = b.year and 
        abs(intck('year', b.enroll_start_dt, a.index_dt, "CONTINUOUS")) &amp;gt;= 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Dec 2017 22:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-intnx-function-correctly/m-p/424125#M104396</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-30T22:13:43Z</dc:date>
    </item>
  </channel>
</rss>

