<?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 isn't intervalds working with intck? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357524#M83941</link>
    <description>&lt;P&gt;Thanks for the detailed explanation, Tammy. &amp;nbsp;Any chance the documentation could have a little extra bit added to it to make this more clear? &amp;nbsp;I figured it out basically by guessing, but at least the way I read the documentation it's not explicit that holes in the begin/end rows will be treated this way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 15:22:33 GMT</pubDate>
    <dc:creator>snoopy369</dc:creator>
    <dc:date>2017-05-10T15:22:33Z</dc:date>
    <item>
      <title>Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357361#M83874</link>
      <description>&lt;P&gt;I know I'm probably overlooking something, but I figured that the following should show me the number or working days between two dates. However, it simply produces an error:&lt;/P&gt;
&lt;PRE&gt;options intervalds=(wdays=wrkdays);
data wrkdays (keep=begin end);
  format begin end date9.;
  array holidays(6);
  do date = '01jan1971'd to '31dec2070'd ;
    if date eq intnx('year',date,0,'b') then do;
      call missing(of holidays(*));
      i=0;
    end;
    if date eq holiday('NEWYEAR', year(date)) or
       date eq holiday('USINDEPENDENCE',year(date)) or
       date eq holiday('THANKSGIVING', year(date)) or
       date eq holiday('CHRISTMAS', year(date)) or
       date eq holiday('MEMORIAL', year(date)) or
       date eq holiday('LABOR', year(date)) then do;
      i+1;
      holidays(i)=date;
    end;
    if date not in holidays and weekday(date) not in (1,7) then do;
      begin=date;
      end=date;
      output;
    end;
  end;
run;
data test;
  days=intck('wdays','1jan2017'd,'31jan2017'd)+1;
run;
&lt;/PRE&gt;
&lt;P&gt;Anyone have a clue as to what I did wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 03:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357361#M83874</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-10T03:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357364#M83875</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wrkdays (keep=begin end);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Remove the END variable. For some reason it only wants the BEGIN variable. Works then, without error on SAS UE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Editor's note: further in-depth explanation from INTCK developer&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86407"&gt;@TammyJackson&lt;/a&gt;:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm the developer for custom intervals and INTCK and I can explain this to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this code to examine the beginning and ending of 2017:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data beg2017;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdays(where=(begin&amp;gt;'25DEC2016'D and begin&amp;lt;'07JAN2017'D));
run;
proc print;run;
data end2017;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdays(where=(begin&amp;gt;'25DEC2017'D and begin&amp;lt;'07JAN2018'D));
run;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Here are the results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2016
&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016
&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016
&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016
&lt;FONT color="#FF0000"&gt;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016
&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2017&lt;/FONT&gt;
&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017
&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017
&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017
&amp;nbsp;10&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017
&amp;nbsp;
Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2017
&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017
&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017
&lt;FONT color="#FF0000"&gt;&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017
&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2018&lt;/FONT&gt;
&amp;nbsp;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018
&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018
&amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice that January 1, 2017 is in a &lt;EM&gt;hole&lt;/EM&gt; between the 30DEC2016 and 02JAN2017. January 1, 2017 is not included in any defined interval listed in the data set. That is, the date 01JAN2017 is not defined for the custom interval since the code identified it as a holiday. The same occurs for January 1, 2018. When the END variable is not present, it is impossible to have holes because END(i) is inferred as BEGIN(i+1)-1. Holes could be useful if observations &lt;STRONG&gt;&lt;EM&gt;absolutely should not&lt;/EM&gt; &lt;/STRONG&gt;occur during a time period. For instance, if the cash register gets opened while a store is closed, then that might be a sign of theft. However, if non-work days are considered to be an extension of the previous or next business days (as in ATM transactions), then you want to simply make your custom interval to include the off periods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;wanted to include the non-work days in the next business day, here is how I would modify your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
options intervalds=(wdaysB=wrkdaysB);
data wrkdaysB (keep=begin end);
&amp;nbsp; format begin end date9.;
&amp;nbsp; array holidays(6);
&lt;FONT color="#FF0000"&gt;&amp;nbsp; /* Last weekday preceding 01JAN1971 */
&amp;nbsp; end = INTNX('weekday','31DEC1970'D,0);&lt;/FONT&gt;
&amp;nbsp; do date = '01jan1971'd to '31dec2070'd ;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if date eq intnx('year',date,0,'b') then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(of holidays(*));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if date eq holiday('NEWYEAR', year(date)) or
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('USINDEPENDENCE',year(date)) or
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('THANKSGIVING', year(date)) or
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('CHRISTMAS', year(date)) or
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('MEMORIAL', year(date)) or
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('LABOR', year(date)) then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i+1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; holidays(i)=date;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if date not in holidays and weekday(date) not in (1,7) then do;
&amp;nbsp;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin=end+1;&lt;/FONT&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end=date;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp; end;
run;
data test;
&amp;nbsp; days=intck('wdaysB','1jan2017'd,'31jan2017'd)+1;
run;
data beg2017;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdaysB(where=(begin&amp;gt;'25DEC2016'D and begin&amp;lt;'07JAN2017'D));
run;
proc print;run;
data end2017;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdaysB(where=(begin&amp;gt;'25DEC2017'D and begin&amp;lt;'07JAN2018'D));
run;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the results - no holes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016
&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016
&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016
&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016
&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2017
&amp;nbsp;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017
&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017
&amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017
&amp;nbsp;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017
&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017
&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017
&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2018
&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018
&amp;nbsp;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018
&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018
&amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 08JAN2018&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice in this case, that a transaction that occurs on January 1, 2017 is considered to be the same business day as January 2, 2017.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 17:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357364#M83875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-10T17:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357365#M83876</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;: Much appreciated! How did you deduce that was the problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 03:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357365#M83876</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-10T03:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357367#M83878</link>
      <description>&lt;P&gt;I compared it to the example in the documentation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only difference I could find was END so I dropped it and that worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 03:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357367#M83878</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-10T03:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357495#M83933</link>
      <description>&lt;P&gt;A while ago&lt;A href="http://blogs.sas.com/content/sasdummy/2011/05/09/calculating-the-number-of-working-days-between-two-dates/" target="_self"&gt; I implemented a version of NETWORKDAYS&lt;/A&gt;, a function cribbed from Microsoft Excel. &amp;nbsp;I wrote it mainly as an example of FCMP, but folks have been using it as a utility.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;, We're chasing down the "END" variable nuance you discovered. &amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;found that the name ("end") seems to be a trigger. &amp;nbsp;Dropping or renaming it solves the problem. &amp;nbsp;If it's a bug, we'll dedicate the fix to you and give you naming rights.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 14:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357495#M83933</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-05-10T14:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357506#M83937</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;: It's definitely an inconsistency. Paragraph 2 of the page&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_intervals_sect008.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_intervals_sect008.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;states:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Create a data set that describes the custom interval. The data set must contain a &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;BEGIN&lt;/SPAN&gt;&lt;SPAN&gt; variable. It can also contain an &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;END&lt;/SPAN&gt;&lt;SPAN&gt; and a &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;SEASON&lt;/SPAN&gt;&lt;SPAN&gt; variable. It should contain a FORMAT statement for the &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;BEGIN&lt;/SPAN&gt;&lt;SPAN&gt; variable that specifies a SAS date, SAS datetime, or numeric format that matches the &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;BEGIN&lt;/SPAN&gt;&lt;SPAN&gt; variable data. If the &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;END&lt;/SPAN&gt;&lt;SPAN&gt; variable is present, it should also be included in the FORMAT statement. A numeric format that is not a SAS date or SAS datetime format indicates that the values are observation numbers. If the &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;END&lt;/SPAN&gt;&lt;SPAN&gt; variable is not present, then the implied value of &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;END&lt;/SPAN&gt;&lt;SPAN&gt; at each observation is one less than the value of &lt;/SPAN&gt;&lt;SPAN class="variable"&gt;BEGIN&lt;/SPAN&gt;&lt;SPAN&gt; at the next observation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I'll trade Naming rights for a free year's SAS license &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Art, CEO, AnalystFinder.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 14:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357506#M83937</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-10T14:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357511#M83938</link>
      <description>&lt;P&gt;I don't think it's END specifically (though I would obviously defer to Chris and Rick and company since they've got the inside scoop).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I think is happening is that with END specified the way Art did - there are days that are not in _any_ interval. &amp;nbsp;While I would implement this differently (to tolerate that), obviously it wasn't. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reeza's suggestion of dropping END must mean that SAS assumes the END is the _next_ begin; so that works. &amp;nbsp;But you could also make this work directly. &amp;nbsp;Here's the simpler (weekday only, ignoring holiday) version, though Art's could be nearly identically modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data work.an_interval;
  format begin end date9.; 
  do begin = '01JAN2010'd to '01JAN2018'd;
    end=begin;
    do while (weekday(end) in (1,7));
      end=end+1;
    end;
    output;
    begin=end;
  end;
run;

options intervalds=(testint=work.an_interval);

data test;
  days=intck('testint','1jan2017'd,'31jan2017'd)+1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That works fine (while the BEGIN/END always equal solution doesn't, since 1/1/17 was a weekend). &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, I'm not sure what the value of END is then, since you need to have complete coverage; perhaps it lets you build intervals that intentionally exclude dates that shouldn't be considered valid inputs to the program?&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 14:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357511#M83938</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-05-10T14:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357523#M83940</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm the developer for custom intervals and INTCK and I can explain this to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this code to examine the beginning and ending of 2017:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data beg2017;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdays(where=(begin&amp;gt;'25DEC2016'D and begin&amp;lt;'07JAN2017'D));&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;&lt;/P&gt;
&lt;P&gt;data end2017;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdays(where=(begin&amp;gt;'25DEC2017'D and begin&amp;lt;'07JAN2018'D));&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the results:&lt;/P&gt;
&lt;P&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2016&lt;BR /&gt;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016&lt;BR /&gt;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016&lt;BR /&gt;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016&lt;BR /&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2017&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017&lt;BR /&gt;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017&lt;BR /&gt;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017&lt;BR /&gt;&amp;nbsp;10&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 26DEC2017&lt;BR /&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017&lt;BR /&gt;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017&lt;BR /&gt;&amp;nbsp;&lt;FONT color="#ff0000"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2018&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018&lt;BR /&gt;&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018&lt;BR /&gt;&amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice that January 1, 2017 is in a &lt;EM&gt;hole&lt;/EM&gt; between the 30DEC2016 and 02JAN2017. January 1, 2017 is not included in any defined interval listed in the data set. That is, the date 01JAN2017 is not defined for the custom interval since the code identified it as a holiday. The same occurs for January 1, 2018. When the END variable is not present, it is impossible to have holes because END(i) is inferred as BEGIN(i+1)-1. Holes could be useful if observations &lt;STRONG&gt;&lt;EM&gt;absolutely should not&lt;/EM&gt; &lt;/STRONG&gt;occur during a time period. For instance, if the cash register gets opened while a store is closed, then that might be a sign of theft. However, if non-work days are considered to be an extension of the previous or next business days (as in ATM transactions), then you want to simply make your custom interval to include the off periods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;wanted to include the non-work days in the next business day, here is how I would modify your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options intervalds=(wdaysB=wrkdaysB);&lt;BR /&gt;data wrkdaysB (keep=begin end);&lt;BR /&gt;&amp;nbsp; format begin end date9.;&lt;BR /&gt;&amp;nbsp; array holidays(6);&lt;BR /&gt;&amp;nbsp;&lt;FONT color="#ff0000"&gt; /* Last weekday preceding 01JAN1971 */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; end = INTNX('weekday','31DEC1970'D,0);&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; do date = '01jan1971'd to '31dec2070'd ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if date eq intnx('year',date,0,'b') then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(of holidays(*));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if date eq holiday('NEWYEAR', year(date)) or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('USINDEPENDENCE',year(date)) or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('THANKSGIVING', year(date)) or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('CHRISTMAS', year(date)) or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('MEMORIAL', year(date)) or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date eq holiday('LABOR', year(date)) then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i+1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; holidays(i)=date;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if date not in holidays and weekday(date) not in (1,7) then do;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin=end+1;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end=date;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;BR /&gt;data test;&lt;BR /&gt;&amp;nbsp; days=intck('wdaysB','1jan2017'd,'31jan2017'd)+1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data beg2017;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdaysB(where=(begin&amp;gt;'25DEC2016'D and begin&amp;lt;'07JAN2017'D));&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;&lt;/P&gt;
&lt;P&gt;data end2017;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set wrkdaysB(where=(begin&amp;gt;'25DEC2017'D and begin&amp;lt;'07JAN2018'D));&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the results - no holes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2016&lt;BR /&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2016&lt;BR /&gt;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2016&lt;BR /&gt;&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2016&lt;BR /&gt;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31DEC2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2017&lt;BR /&gt;&amp;nbsp;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2017&lt;BR /&gt;&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2017&lt;BR /&gt;&amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2017&lt;BR /&gt;&amp;nbsp;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2017&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 27DEC2017&lt;BR /&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 28DEC2017&lt;BR /&gt;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 29DEC2017&lt;BR /&gt;&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30DEC2017&amp;nbsp;&amp;nbsp;&amp;nbsp; 02JAN2018&lt;BR /&gt;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 03JAN2018&lt;BR /&gt;&amp;nbsp;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 04JAN2018&lt;BR /&gt;&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 05JAN2018&lt;BR /&gt;&amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 06JAN2018&amp;nbsp;&amp;nbsp;&amp;nbsp; 08JAN2018&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice in this case, that a transaction that occurs on January 1, 2017 is considered to be the same business day as January 2, 2017.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 15:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357523#M83940</guid>
      <dc:creator>TammyJackson</dc:creator>
      <dc:date>2017-05-10T15:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357524#M83941</link>
      <description>&lt;P&gt;Thanks for the detailed explanation, Tammy. &amp;nbsp;Any chance the documentation could have a little extra bit added to it to make this more clear? &amp;nbsp;I figured it out basically by guessing, but at least the way I read the documentation it's not explicit that holes in the begin/end rows will be treated this way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 15:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357524#M83941</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-05-10T15:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357533#M83945</link>
      <description>&lt;P&gt;Quite often users just omit the END variable. It is extra programming, and if omitted, END[i] = BEGIN[i+1]-1, which gives the usually desired result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm#n1n5ezpid8tfkhn1nzmb3foy5opw" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm#n1n5ezpid8tfkhn1nzmb3foy5opw&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 class="xis-title"&gt;Reasons for Using Custom Time Intervals&lt;/H3&gt;
&lt;DIV class="xis-topicContent" id="p03d9qdt1wens7n18eky5oep0c86"&gt;
&lt;DIV class="xis-paragraph" id="p14btwzwys05ran1gumf6oi70mtl"&gt;Standard time intervals (for example, QTR, MONTH, WEEK, and so on) do not always fit the data. Also, some time series are measured at standard intervals where there are gaps in the data. For example, you might want to use fiscal months that begin on the 10th day of each month. In this case, using the MONTH interval is not appropriate because the MONTH interval begins on the 1st day of each month. You can use a custom interval to model data at a frequency that is familiar to the business and to eliminate gaps in the data by compressing the data. &lt;FONT color="#ff0000"&gt;The intervals must be listed in ascending order. There cannot be gaps between intervals, and intervals cannot overlap.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&lt;FONT color="#000000"&gt;OK, so there can be gaps between intervals - at your own risk. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;
&lt;DIV class="xis-paragraphFirst" id="n1p6oh28ynkcw2n1l84hstn59ftd"&gt;Create a data set that describes the custom interval.&lt;/DIV&gt;
&lt;DIV class="xis-paragraph" id="n1bhfzzxefrf2qn1hw5o0jmi7raa"&gt;The data set must contain the &lt;SPAN class="xis-userSuppliedValue"&gt;begin&lt;/SPAN&gt; variable; it can also contain &lt;SPAN class="xis-userSuppliedValue"&gt;end&lt;/SPAN&gt; and &lt;SPAN class="xis-userSuppliedValue"&gt;season&lt;/SPAN&gt; variables. In your SAS program, include a FORMAT statement that is associated with the &lt;SPAN class="xis-userSuppliedValue"&gt;begin&lt;/SPAN&gt; variable that specifies a SAS date, datetime, or numeric format that matches the &lt;SPAN class="xis-userSuppliedValue"&gt;begin&lt;/SPAN&gt; variable data. If an &lt;SPAN class="xis-userSuppliedValue"&gt;end&lt;/SPAN&gt; variable is present, include it in the FORMAT statement. A numeric format that is not a SAS date or SAS datetime format indicates that the values are observation numbers.&lt;FONT color="#ff0000"&gt; If the &lt;SPAN class="xis-userSuppliedValue"&gt;end&lt;/SPAN&gt; variable is not present, the implied value of &lt;SPAN class="xis-userSuppliedValue"&gt;end&lt;/SPAN&gt; at each observation is one less than the value of &lt;SPAN class="xis-userSuppliedValue"&gt;begin&lt;/SPAN&gt; at the next observation.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 May 2017 15:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357533#M83945</guid>
      <dc:creator>TammyJackson</dc:creator>
      <dc:date>2017-05-10T15:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357537#M83946</link>
      <description>I think if that last sentence of the first paragraph were in the main&lt;BR /&gt;interval page it would be perfect (with the added detail you imply in the&lt;BR /&gt;editorial sentence of course a bonus) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  Unfortunately that particular&lt;BR /&gt;page isn't one that came up in my first glance at the topic, though perhaps&lt;BR /&gt;it would have eventually...&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 10 May 2017 15:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357537#M83946</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-05-10T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357539#M83948</link>
      <description>&lt;P&gt;I can contact the documentation person and ask them to add a statement like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Omitting the END variable ensures that no gaps exist in the data definition. Since gaps in the data can cause errors in processing, if the END variable is included, extra care should be taken to properly define the END variable to avoid gaps.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 15:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357539#M83948</guid>
      <dc:creator>TammyJackson</dc:creator>
      <dc:date>2017-05-10T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357540#M83949</link>
      <description>&lt;P&gt;Perfect, thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/61001"&gt;@ChrisD&lt;/a&gt;&amp;nbsp;Email replies seem a bit buggy... both of them double-posted and include the ##- Please Type Your Reply Above ... text...&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 15:42:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357540#M83949</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-05-10T15:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357544#M83952</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86407"&gt;@TammyJackson&lt;/a&gt;: I agree and thanks for looking into it!&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46466"&gt;@snoopy369&lt;/a&gt;: Joe, very much appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 15:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357544#M83952</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-10T15:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357587#M83971</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46466"&gt;@snoopy369&lt;/a&gt;&amp;nbsp;- I think you meant to mention me, not poor ChrisD. &amp;nbsp;And all: I'm going to modify the accepted solution on this to include the excellent explanation from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86407"&gt;@TammyJackson&lt;/a&gt;, as I think that will serve future readers quite well. &amp;nbsp;Don't worry:&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;still gets the credit.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 17:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357587#M83971</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-05-10T17:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357589#M83973</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;Feel free to change the correct answer to Tammy's, I don't really need any more points from correct answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 17:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357589#M83973</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-10T17:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't intervalds working with intck?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357637#M84003</link>
      <description>&lt;P&gt;We will add this information to the next release, 9.4M5 of the SAS 9.4 Functions and CALL Routines: Reference document.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 18:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-intervalds-working-with-intck/m-p/357637#M84003</guid>
      <dc:creator>daharr</dc:creator>
      <dc:date>2017-05-10T18:45:23Z</dc:date>
    </item>
  </channel>
</rss>

