<?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: how to extract first and last day from a month? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387195#M92813</link>
    <description>&lt;P&gt;Hi ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the detailed reply and tips .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added a variable to hold the date part and used the le operator as suggested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the if conditions to check if the person is active for the month. so in case the person is active for a month, i just want the effective date and term date to be set as first and last of the month. so if a person is active starting from previous month to next month , i just want start date july and end date july&amp;nbsp;as first and last of the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 23:19:46 GMT</pubDate>
    <dc:creator>Sheeba</dc:creator>
    <dc:date>2017-08-10T23:19:46Z</dc:date>
    <item>
      <title>how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386784#M92687</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am creating a macro variable&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; month_to_process = july;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;How do I extract the first day and last day of the month to be used in a series of if conditions below?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; elig_subset_08092017;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; elig_subset;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*for july*/&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(EFFECTIVE_DT)&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; effective_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; term_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(EFFECTIVE_DT) le &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(EFFECTIVE_DT) ge &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(term_date)&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;effective_date_july =datepart(EFFECTIVE_DT);&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; term_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;effective_date_july =datepart(EFFECTIVE_DT);&lt;/P&gt;
&lt;P&gt;term_date_july =datepart(term_date);&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(EFFECTIVE_DT) &amp;lt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(term_date)&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; effective_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; term_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (datepart(term_date) ge &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (datepart(term_date) le &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; effective_date_july = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;term_date_july =datepart(term_date);&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; datepart(term_date)&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; effective_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; term_date_july =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31jul2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate any help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 19:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386784#M92687</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2017-08-09T19:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386803#M92695</link>
      <description>&lt;P&gt;Use the intnx() function with 'month' and 'begin' and 'end'.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 20:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386803#M92695</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-09T20:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386815#M92698</link>
      <description>&lt;P&gt;SAS supports comparisons like&amp;nbsp; 5 &amp;lt; variable &amp;lt; 25&lt;/P&gt;
&lt;P&gt;so you can make this code&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else if datepart(EFFECTIVE_DT) le '31jul2017'd and datepart(EFFECTIVE_DT) ge '01jul2017'd then&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into this:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;&lt;FONT size="3"&gt;else if '01jul2017'd le datepart(EFFECTIVE_DT) le '31jul2017'd  then
&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;But even easier unless your data is multiyear:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;&amp;nbsp; else if month(datepart(effective_dt))=7;&lt;BR /&gt;If you are going to use datepart(effictive_dt) so many places you might as well make a temporary variable to make code easier to read.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;You might discuss the purpose of those If conditions. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 21:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386815#M92698</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-09T21:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386855#M92708</link>
      <description>&lt;P&gt;I am not sure you are starting with enough information.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let month_to_process = july;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For what year do you want JULY dates for? 2017? &amp;nbsp;2016? 2018?&lt;/P&gt;
&lt;P&gt;If you start with a date value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let month_to_process = '01JUL2017'd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you could use INTNX() function to find the first and last day of that month.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let firstday=%sysfunc(intnx(month,&amp;amp;month_to_process,0,b));
%let lastday=%sysfunc(intnx(month,&amp;amp;month_to_process,0,e));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of if you would prefer human readable values then perhaps you could generate them as date literals.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let firstday="%sysfunc(intnx(month,&amp;amp;month_to_process,0,b),date9)"d;
%let lastday="%sysfunc(intnx(month,&amp;amp;month_to_process,0,e),date9)"d;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 02:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/386855#M92708</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-10T02:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387194#M92812</link>
      <description>&lt;P&gt;Hi &lt;A class="lia-link-navigation lia-page-link lia-user-name-link" id="link_16" style="color: rgb(0, 153, 153);" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_self"&gt;&lt;SPAN class="login-bold"&gt;KurtBremser&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the INTNX&amp;nbsp; function and got the required results&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 23:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387194#M92812</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2017-08-10T23:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387195#M92813</link>
      <description>&lt;P&gt;Hi ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the detailed reply and tips .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added a variable to hold the date part and used the le operator as suggested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the if conditions to check if the person is active for the month. so in case the person is active for a month, i just want the effective date and term date to be set as first and last of the month. so if a person is active starting from previous month to next month , i just want start date july and end date july&amp;nbsp;as first and last of the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 23:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387195#M92813</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2017-08-10T23:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract first and last day from a month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387196#M92814</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the details and code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used this and is working successfully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 23:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-first-and-last-day-from-a-month/m-p/387196#M92814</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2017-08-10T23:21:46Z</dc:date>
    </item>
  </channel>
</rss>

