<?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: Meaning of 2nd argument to HOLIDAYNAME function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613045#M178994</link>
    <description>&lt;P&gt;Perhaps I should ask a broader question ... I want to identify holidays, not only this year but perhaps several years in the future or past. What is a good method to do this? With HOLIDAYNAME() I can identify not only THANKSGIVING and PRESIDENTS day in the US, but I can also ignore other holidays not relevant to my project such as HALLOWEEN.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2019 14:16:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-12-19T14:16:27Z</dc:date>
    <item>
      <title>Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613022#M178985</link>
      <description>&lt;P&gt;What does the second argument to the HOLIDAYNAME function do? The documentation is basically non-explanatory here. It says "N&amp;nbsp; specified the index". No further explanation about what the index does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to say that usually, SAS documentation is excellent, but here it falls flat on its face.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 13:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613022#M178985</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-19T13:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613024#M178986</link>
      <description>&lt;P&gt;Good morning Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; Thank you for the excellent question. Here is my guess on reviewing the example in the documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
   length Holiday $32;
   format date weekdatx17.;
   do year=2000 to 2010;
      date=mdy(11,11,year);
      ObsVetNov11=holidaycount(date);
      do index=1 to ObsVetNov11;
         Holiday=holidayname(date,index);
         output;
      end;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Apparently the index refers to the same day i.e if holiday is being referred to more than one holidayname. The index number seems to provide that unique internal lookup identifier that fetches distinct holidaynames for the same date. As the program computes the hoildaycount, which is used in nested loop, my thought process invariably points to that understanding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, British dominions have boxing day and the same has different names in different countries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My 2 cents!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 13:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613024#M178986</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-19T13:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613035#M178990</link>
      <description>&lt;P&gt;That's a very good explanation&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;and probably correct, but it still leaves me unable to use this argument as I don't know what the meanings of index=1 and index=2 and index=3 are, and what all the possible results are from the HOLIDAYNAME function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, a horrible failure of the documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 13:51:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613035#M178990</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-19T13:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613042#M178992</link>
      <description>&lt;P&gt;Yes true and I agree. SAS Inc should have a LOOK-UP reference file. And considering, SAS a global company, the LOOK UP reference file for holidays should account for all countries where SAS operates.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 14:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613042#M178992</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-19T14:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613045#M178994</link>
      <description>&lt;P&gt;Perhaps I should ask a broader question ... I want to identify holidays, not only this year but perhaps several years in the future or past. What is a good method to do this? With HOLIDAYNAME() I can identify not only THANKSGIVING and PRESIDENTS day in the US, but I can also ignore other holidays not relevant to my project such as HALLOWEEN.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 14:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613045#M178994</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-19T14:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613085#M179011</link>
      <description>&lt;P&gt;It looks like the index allows you to discern between different holidays that have fallen on the same date.&lt;/P&gt;
&lt;P&gt;In &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;'s example, Veteran's day is observed in three different holiday schemes: Julian/calendar, US Gov., Postal (USPS). The index is somewhat unpredictable for holidays that depend on whether or not the true calendar day falls on a weekend (US Government holidays will always fall on a weekday -- fantastic if you work in the Public sector :)). See here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   length holiday $32;
   format date weekdatx17.;
   do date='01jan2017'd to '31dec2019'd;
      cnt=holidaycount(date);
      do index=1 to cnt;
         holiday=holidayname(date,index);
         if holiday in ('VETERANS' 'VETERANSUSG') then output;
      end;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want only specific holiday dates for a given time range, you might scan across the years of interest and then pull out the holidays you want by name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-unison&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 16:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613085#M179011</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2019-12-19T16:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of 2nd argument to HOLIDAYNAME function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613087#M179013</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Perhaps I should ask a broader question ... I want to identify holidays, not only this year but perhaps several years in the future or past. What is a good method to do this? With HOLIDAYNAME() I can identify not only THANKSGIVING and PRESIDENTS day in the US, but I can also ignore other holidays not relevant to my project such as HALLOWEEN.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maybe the HOLIDAYNX function would help. This examples gets the next 10 Thanksgiving dates relative the to first of October in 2019.&lt;/P&gt;
&lt;PRE&gt;data example;
   do i=1 to 10;
      thxdate= holidaynx('Thanksgiving','01OCT2019'd,i);
      output;
   end;
   format thxdate date9.;
run; &lt;/PRE&gt;
&lt;P&gt;I picked Thanksgiving since the date move a bit.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 16:09:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-2nd-argument-to-HOLIDAYNAME-function/m-p/613087#M179013</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-19T16:09:11Z</dc:date>
    </item>
  </channel>
</rss>

