<?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: date value of last friday of every  month for a particular year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758041#M239323</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/327170"&gt;@Aexor&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p1kdveu0ry8ltxn1m3um2ntxs7d5.htm" target="_blank" rel="noopener"&gt;NWKDOM function&lt;/A&gt; is ideal for calculations like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
year=2021;
run;

data want(drop=y:);
set have;
do _n_=1 to 12;
  month=intnx('month',mdy(1,1,year),_n_-1);
  last_fri=nwkdom(5,6,_n_,year);
  output;
end;
format m: monyy7. l: ddmmyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Jul 2021 11:10:59 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-07-29T11:10:59Z</dc:date>
    <item>
      <title>date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758024#M239309</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me below query .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need date for last&amp;nbsp; friday for every month&amp;nbsp;&lt;/P&gt;
&lt;P&gt;like&lt;/P&gt;
&lt;P&gt;JAN2021&amp;nbsp; -&amp;gt; 29/01/2021&lt;/P&gt;
&lt;P&gt;FEB2021 -&amp;gt;&amp;nbsp;26/02/2021&lt;/P&gt;
&lt;P&gt;MAR2021 -&amp;gt;&amp;nbsp;26/03/2021&lt;/P&gt;
&lt;P&gt;APR2021 -&amp;gt; 30/04/2021&lt;/P&gt;
&lt;P&gt;MAY2021 -&amp;gt; 28/05/2021&lt;/P&gt;
&lt;P&gt;and so on till DEC2021&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758024#M239309</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2021-07-29T10:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758027#M239311</link>
      <description>&lt;P&gt;What exactly do you have at the beginning? A dataset with strings like "Jan2021" or SAS-dates formatted to show only month and year?&lt;/P&gt;
&lt;P&gt;With strings:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have_want;
   format date eom date9.;
   var = "JAN2021";
   date = input(cats('1', quote(trim(var)), 'd'), date9.);
   eom = intnx('month', date, 0, 'e');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you already have a sas-date, just skip calling input.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758027#M239311</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-29T10:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758029#M239313</link>
      <description>I want to create something dynamic . &lt;BR /&gt;Input i have is only year like "2021"&lt;BR /&gt;I want to create coloums which will consist values &lt;BR /&gt;JAN2021  29/01/2021&lt;BR /&gt;FEB2021  26/02/2021&lt;BR /&gt;MAR2021  26/03/2021&lt;BR /&gt;APR2021  30/04/2021&lt;BR /&gt;MAY2021  28/05/2021</description>
      <pubDate>Thu, 29 Jul 2021 10:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758029#M239313</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2021-07-29T10:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758035#M239317</link>
      <description>&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let year=2021;

data want;
month = "0101&amp;amp;year."d;
format
  month yymmd7.
  l_day yymmdd10.
;
do while (month le "31dec&amp;amp;year."d);
  l_day = intnx('month',month,0,"e");
  l_day = l_day - mod(weekday(l_day)+1,7);
  weekday = weekday(l_day);
  output;
  month = intnx('month',month,1);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758035#M239317</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-29T12:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758037#M239319</link>
      <description>&lt;P&gt;My fault, over-read that you want last Friday, thought last of the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758037#M239319</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-29T10:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758038#M239320</link>
      <description>Sure. I dont  have data as such. the requirement is i have only year value that is "2021" and i want to code to get date values for last Friday of each month of year 2021. &lt;BR /&gt;&lt;BR /&gt;I will try to replicate the same with data.not sure whether it explains the requirement  clearly  or not &lt;BR /&gt;Have  data set &lt;BR /&gt;Year&lt;BR /&gt;2021&lt;BR /&gt;&lt;BR /&gt;Want data set&lt;BR /&gt;want&lt;BR /&gt;JAN2021 29/01/2021&lt;BR /&gt;FEB2021 26/02/2021&lt;BR /&gt;MAR2021 26/03/2021&lt;BR /&gt;APR2021 30/04/2021&lt;BR /&gt;MAY2021 28/05/2021&lt;BR /&gt;&lt;BR /&gt;this will go till DEC2021 and date value of last Friday of December &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758038#M239320</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2021-07-29T10:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758041#M239323</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/327170"&gt;@Aexor&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p1kdveu0ry8ltxn1m3um2ntxs7d5.htm" target="_blank" rel="noopener"&gt;NWKDOM function&lt;/A&gt; is ideal for calculations like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
year=2021;
run;

data want(drop=y:);
set have;
do _n_=1 to 12;
  month=intnx('month',mdy(1,1,year),_n_-1);
  last_fri=nwkdom(5,6,_n_,year);
  output;
end;
format m: monyy7. l: ddmmyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jul 2021 11:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758041#M239323</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-07-29T11:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: date value of last friday of every  month for a particular year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758054#M239331</link>
      <description>&lt;P&gt;I should follow my own Maxims &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Maxim 9: There Is a Function for It.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-value-of-last-friday-of-every-month-for-a-particular-year/m-p/758054#M239331</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-29T12:13:50Z</dc:date>
    </item>
  </channel>
</rss>

