<?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: Excluding holidays and weekends from monthly time series data in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244822#M1548</link>
    <description>&lt;P&gt;Which holidays?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has a function HOLIDAY that returns the date of a specified holiday for a given year.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   x=holiday('easter',2016);
   put 'Easter is ' x mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So for US and Canada at least you can get dates of specific holidays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2016 21:19:26 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-01-20T21:19:26Z</dc:date>
    <item>
      <title>Excluding holidays and weekends from monthly time series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244816#M1547</link>
      <description>&lt;P&gt;I have monthly time series data that i want to adjust based on number of working days in the month. i figured how to exclude the weekends using the following macro:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data Regions2;&lt;BR /&gt;set Regions;&lt;BR /&gt;format Date last_day mmddyy10.;&lt;BR /&gt; do year = 2013 to 2016;&lt;BR /&gt; do month = 1 to 12;&lt;BR /&gt; Date = mdy(month, 1, year);&lt;BR /&gt; last_day = intnx('month', Date, 0, 'e');&lt;BR /&gt; days = intck('day', Date, last_day) + 1;&lt;BR /&gt; weekdays = intck('weekday', Date, last_day) + 1;&lt;BR /&gt; weeks = intck('week', Date, last_day);&lt;BR /&gt; hours = intck('dthour', dhms(Date, 0, 0,0), dhms(last_day, 23, 59, 59)) + 1;&lt;BR /&gt; work_hours = weekdays * 8;&lt;BR /&gt; by region;&lt;BR /&gt; output;&lt;BR /&gt; end; /* end month */&lt;BR /&gt; end; /* end year */&lt;BR /&gt; label&lt;BR /&gt; Date = 'First day'&lt;BR /&gt; last_day = 'Last day'&lt;BR /&gt; days = 'Days'&lt;BR /&gt; weekdays = 'Week days'&lt;BR /&gt; weeks = 'Weeks'&lt;BR /&gt; hours = 'Hours'&lt;BR /&gt; work_hours = 'Work hours'&lt;BR /&gt; ;&lt;BR /&gt; drop month year;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but how do i also take into account the holidays in the calculations above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 20:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244816#M1547</guid>
      <dc:creator>mmyrto</dc:creator>
      <dc:date>2016-01-20T20:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding holidays and weekends from monthly time series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244822#M1548</link>
      <description>&lt;P&gt;Which holidays?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has a function HOLIDAY that returns the date of a specified holiday for a given year.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   x=holiday('easter',2016);
   put 'Easter is ' x mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So for US and Canada at least you can get dates of specific holidays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244822#M1548</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-20T21:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding holidays and weekends from monthly time series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244824#M1549</link>
      <description>&lt;P&gt;&lt;FONT color="#333399"&gt;New Year's Day&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;Martin Luther King Day&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;Memorial Day&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;Independence Day&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;Labor Day&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;Christmas Day Observance&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244824#M1549</guid>
      <dc:creator>mmyrto</dc:creator>
      <dc:date>2016-01-20T21:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding holidays and weekends from monthly time series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244841#M1550</link>
      <description>&lt;P&gt;Since those dates aren't in the calendar you have to make your own calendar and then you can use that custom interval instead of the weekday interval in the intnx and intck functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's a bit of a write up on it here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Generating_Holiday_Lists" target="_blank"&gt;http://www.sascommunity.org/wiki/Generating_Holiday_Lists&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in mind that Christmas observance can be very company specific, for example, Christmas Eve is included in my companies benefits.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW - none of this is macro logic &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 22:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Excluding-holidays-and-weekends-from-monthly-time-series-data/m-p/244841#M1550</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-20T22:59:15Z</dc:date>
    </item>
  </channel>
</rss>

