<?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 2nd working day of every month macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821647#M324394</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could someone help me with any macros that i can use to schedule the report on 2nd working day of every month for UK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;vnreddy&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2022 16:57:17 GMT</pubDate>
    <dc:creator>vnreddy</dc:creator>
    <dc:date>2022-07-05T16:57:17Z</dc:date>
    <item>
      <title>2nd working day of every month macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821647#M324394</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could someone help me with any macros that i can use to schedule the report on 2nd working day of every month for UK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;vnreddy&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 16:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821647#M324394</guid>
      <dc:creator>vnreddy</dc:creator>
      <dc:date>2022-07-05T16:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: 2nd working day of every month macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821651#M324397</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you using SAS 9.4 or SAS VIYA 3.5 or SAS VIYA 4?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are several ways to achieve this (as always &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; ).&lt;/P&gt;
&lt;P&gt;First thing might be to identify the 2nd working day of every month.&lt;/P&gt;
&lt;P&gt;Here are some examples that you can use as a start :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* FIRST MONDAY of the MONTH */
data _NULL_;
  file print;
  year = year(today());
  do month = 1 to 12;
    firstDayMonth = mdy(month, 1, year);
    firstWorkDay  = NWKDOM(1, 2, month, year);
    PUT @1  firstDayMonth= weekdate.;
	PUT @50 firstWorkDay = weekdate.;
  end;
run;

/* second to last working day of the month                                */
/* Add HOLIDAYTEST Function (!!) to check if there's any holiday involved */
data _NULL_;
 file print;
  year = year(today());
  do month = 1 to 12;
    lastDay=intnx('weekday',intnx('month',mdy(month, 1, year),0,'E'),-1);
    PUT @1  lastDay= weekdate.;
  end; 
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 18:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821651#M324397</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-07-05T18:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: 2nd working day of every month macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821954#M324524</link>
      <description>&lt;P&gt;Why do you need to use a SAS macro when a scheduling tool can do this without any coding? Ask your SAS administrator about this.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 00:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2nd-working-day-of-every-month-macros/m-p/821954#M324524</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-07-07T00:34:07Z</dc:date>
    </item>
  </channel>
</rss>

