<?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: find first day of current month,prev month,next month in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847317#M36943</link>
    <description>&lt;P&gt;The basis indicators 'B' (begin), 'E' (end), 'S' (same) are helpful&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data test;
  date="02DEC2022"d;
  Frstdaycurrentmonth=Intnx("month",date,0,'B');
  FrstdayPrevMonth=Intnx("month",date,-1,'B');
  FrstdayNextmonth=Intnx("month",date,1,'B');
  FrstdayThisYear = intnx('year',date,0,'B');
  LastdayThisYear = intnx('year',date,0,'E');
  FrstdayLastYear = intnx('year',date,-1,'B');
  LastdayLastYear = intnx('year',date,-1,'E');
  FrstdayNextYear = intnx('year',date,1,'B');
  LastdayNextYear = intnx('year',date,1,'E');

  SamedayPrevMonth=Intnx("month",date,-1,'S');
  SamedayNextmonth=Intnx("month",date,1,'S');
  SamedayPrevYear=Intnx("year",date,-1,'S');
  SamedayNextYear=Intnx("year",date,1,'S');

  format date frstday: lastday: Sameday: date9.;
 
run;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Dec 2022 19:06:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-12-01T19:06:35Z</dc:date>
    <item>
      <title>find first day of current month,prev month,next month</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847311#M36939</link>
      <description>&lt;P&gt;I want to find First day of current month, Previous month , Next month as the below code is getting an error&lt;/P&gt;&lt;P&gt;Data test;&lt;/P&gt;&lt;P&gt;date="02DEC2022"d;&lt;/P&gt;&lt;P&gt;Frstday=Intnx("date",date,0);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847311#M36939</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-01T18:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: find first day of current month,prev month,next month</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847312#M36940</link>
      <description>&lt;P&gt;There is no "Date" value for the first argument to INTNX. You want to use the "Month" argument here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Frstday=Intnx("month",date,0,'b');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847312#M36940</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-01T18:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: find first day of current month,prev month,next month</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847313#M36941</link>
      <description>&lt;P&gt;In the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p10v3sa3i4kfxfn1sovhi5xzxh8n.htm" target="_blank" rel="noopener"&gt;INTNX Function&lt;/A&gt;&amp;nbsp;, use an interval of "month" and the additional modifier "b" (for begin).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847313#M36941</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-01T18:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: find first day of current month,prev month,next month</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847314#M36942</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   date="02DEC2022"d;

   prevmonth = intnx('month', date, -1, 'b');
   thismonth = intnx('month', date,  0, 'b');
   nextmonth = intnx('month', date,  1, 'b');

   format prevmonth thismonth nextmonth ddmmyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847314#M36942</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-12-01T18:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: find first day of current month,prev month,next month</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847317#M36943</link>
      <description>&lt;P&gt;The basis indicators 'B' (begin), 'E' (end), 'S' (same) are helpful&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data test;
  date="02DEC2022"d;
  Frstdaycurrentmonth=Intnx("month",date,0,'B');
  FrstdayPrevMonth=Intnx("month",date,-1,'B');
  FrstdayNextmonth=Intnx("month",date,1,'B');
  FrstdayThisYear = intnx('year',date,0,'B');
  LastdayThisYear = intnx('year',date,0,'E');
  FrstdayLastYear = intnx('year',date,-1,'B');
  LastdayLastYear = intnx('year',date,-1,'E');
  FrstdayNextYear = intnx('year',date,1,'B');
  LastdayNextYear = intnx('year',date,1,'E');

  SamedayPrevMonth=Intnx("month",date,-1,'S');
  SamedayNextmonth=Intnx("month",date,1,'S');
  SamedayPrevYear=Intnx("year",date,-1,'S');
  SamedayNextYear=Intnx("year",date,1,'S');

  format date frstday: lastday: Sameday: date9.;
 
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 19:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-first-day-of-current-month-prev-month-next-month/m-p/847317#M36943</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-01T19:06:35Z</dc:date>
    </item>
  </channel>
</rss>

