<?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 Using INTCK day comparison question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152883#M30074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; appeals1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; appeals;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;age_585=intck(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'day'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,lm_set_up_dt,_585);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;In this code I am getting the number of days between lm_set_up_dt and _585(which is a date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;I believe the ‘day’ function does not consider holidays and weekends it just provides a straight day difference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;Is there a way to have ‘day’ account for this by assigning the closest business day.(ie if one of the dates falls on Sunday can ‘day’ increment to Monday&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(ie if _585 falls on Sunday 9/21/14 the code would allow _585 to increment to Monday 9/22/14 for calculation purposes.&amp;nbsp; In our company we do have a previous business day variable called &amp;amp;pbday.&amp;nbsp; I may need to learn how ‘day’ is read by sas&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Sep 2014 01:59:26 GMT</pubDate>
    <dc:creator>Q1983</dc:creator>
    <dc:date>2014-09-20T01:59:26Z</dc:date>
    <item>
      <title>Using INTCK day comparison question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152883#M30074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; appeals1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; appeals;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;age_585=intck(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'day'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,lm_set_up_dt,_585);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;In this code I am getting the number of days between lm_set_up_dt and _585(which is a date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;I believe the ‘day’ function does not consider holidays and weekends it just provides a straight day difference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;Is there a way to have ‘day’ account for this by assigning the closest business day.(ie if one of the dates falls on Sunday can ‘day’ increment to Monday&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(ie if _585 falls on Sunday 9/21/14 the code would allow _585 to increment to Monday 9/22/14 for calculation purposes.&amp;nbsp; In our company we do have a previous business day variable called &amp;amp;pbday.&amp;nbsp; I may need to learn how ‘day’ is read by sas&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 01:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152883#M30074</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2014-09-20T01:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTCK day comparison question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152884#M30075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look into 'weekday' instead of 'day', but it depends on your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you can test if _585 is a day on Sat/Sun and increment. If you want to account for holidays it's more complicated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'Courier New'; color: navy;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt; appeals1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt; appeals;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt;if day(_585)=7 then date=_585+2;/*Saturday*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt;if day(_585)=1 then date=_585+1;/*Sunday*/&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt;age_585=intck(&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: purple;"&gt;'day'&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt;,lm_set_up_dt,date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt;age_585_v2=intck('weekday', lm_set_up_dt, date);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'Courier New'; color: navy;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 02:39:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152884#M30075</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-20T02:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTCK day comparison question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152885#M30076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;intck() will return the difference between to dates based on the interval you're using. With "day" it is the number of days between 2 dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are other intervals. "weekday" is eventually what you're after: &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Weekday will give you the number of - as it says - week days between 2 dates (with Saturday and Sunday treated as week-end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure that I fully understand what you're after so won't try to take this further. Run below code and let us know if this gives you what you're after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Holidays are regional so there is no general interval out of the box available (except for US wide valid holiday days). You can create your own custom interval to take regional holidays into account. It's all documented under the link I've posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format day_of_week downame.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format lm_set_up_dt _585 date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lm_set_up_dt='01Sep2014'd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do _585='18Sep2014'd, '19Sep2014'd, '20Sep2014'd, '21Sep2014'd, '22Sep2014'd, '23Sep2014'd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; day_of_week=_585;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; diff_day=intck('day',lm_set_up_dt,_585);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; diff_weekday=intck('weekday',lm_set_up_dt,_585);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 03:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152885#M30076</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-09-20T03:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using INTCK day comparison question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152886#M30077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the documentation link by Patrick also the intervalds option with custom intervals is mentioned.&lt;/P&gt;&lt;P&gt;You can define and use any interval definition as you like including own defined holidays business working days or business service hours.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 09:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-INTCK-day-comparison-question/m-p/152886#M30077</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-20T09:23:23Z</dc:date>
    </item>
  </channel>
</rss>

