<?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 imputation for partial dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631626#M187164</link>
    <description>INTNX() will allow you to get the last day of the month using the alignment parameter. Use the first as your day and then use the 'e' as the last parameter to increment to the end of the month.&lt;BR /&gt;&lt;BR /&gt;last_month = intnx('month', today(), 0, 'e');&lt;BR /&gt;&lt;BR /&gt;This would return March 30, 2020.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 12 Mar 2020 16:15:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-03-12T16:15:53Z</dc:date>
    <item>
      <title>date imputation for partial dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631617#M187160</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a project newly and that needs to be impute a date asper the requirement&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stop date imputation:- Impute stop date as latest possible date (last day of the particular month if day is unknown or 31December if the day and month are unknwon)&lt;/P&gt;&lt;P&gt;I am having doubt how to get the last day of the month since every month has different last day and we need to consider the leap year also&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;start date :-mpute stop date as earliest possible date (first day of the particular month if day is unknown or 1st january if the day and month are unknwon)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dates will be like below&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Stop date             Start date
2019-03               2018-03
2019                    2017
2018-03-25          2017-02-22&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 15:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631617#M187160</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2020-03-12T15:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: date imputation for partial dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631625#M187163</link>
      <description>&lt;P&gt;Expand the strings as needed, and use the intnx() function to determine the last day of a given month:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input (stop_string start_string) (:$10.);
if length(start_string) = 4 then start_string = cats(start_string,'-01');
if length(start_string) = 7 then start_string = cats(start_string,'-01');
start_date = input(start_string,yymmdd10.);
if length(stop_string) = 4 then stop_string = cats(stop_string,'-12');
if length(stop_string) = 7
then do;
  stop_string = cats(stop_string,'-01');
  stop_date = intnx('month',input(stop_string,yymmdd10.),0,'e');
end;
else stop_date = input(stop_string,yymmdd10.);
format start_date stop_date yymmddd10.;
drop start_string stop_string;
datalines;
2019-03               2018-03
2019                    2017
2018-03-25          2017-02-22
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Mar 2020 16:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631625#M187163</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-12T16:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: date imputation for partial dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631626#M187164</link>
      <description>INTNX() will allow you to get the last day of the month using the alignment parameter. Use the first as your day and then use the 'e' as the last parameter to increment to the end of the month.&lt;BR /&gt;&lt;BR /&gt;last_month = intnx('month', today(), 0, 'e');&lt;BR /&gt;&lt;BR /&gt;This would return March 30, 2020.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2020 16:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-imputation-for-partial-dates/m-p/631626#M187164</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-12T16:15:53Z</dc:date>
    </item>
  </channel>
</rss>

