<?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: If day is missing need to represent the day of the month? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479573#M123825</link>
    <description>&lt;P&gt;Thanks It working.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 16:52:53 GMT</pubDate>
    <dc:creator>rajeshalwayswel</dc:creator>
    <dc:date>2018-07-19T16:52:53Z</dc:date>
    <item>
      <title>If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479564#M123820</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date $ 10.;
cards;
2017-01-01
2016-10
2010-11
;
run;

Required:

2017-01-01
2016-10-31
2010-11-30&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479564#M123820</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-07-19T16:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479565#M123821</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date $ 10.;
cards;
2017-01-01
2016-10
2010-11
;
run;

data want;
set have;
new_date=input(date,anydtdte21.);
if length(date)=7 then new_Date=intnx('month',new_date,0,'e');
format new_date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479565#M123821</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-19T16:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479566#M123822</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

if length(date)&amp;lt;10 then date_num =intnx('month', input(cats(date, '-01'), yymmdd10.), 0, 'e');

else date_num = input(date, yymmdd10.);
format date_num date9.;


run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479566#M123822</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T16:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479570#M123823</link>
      <description>&lt;P&gt;Thanks to both. but the year is leap year in this scenario what would be the solution?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479570#M123823</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-07-19T16:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479571#M123824</link>
      <description>&lt;P&gt;Please test and let me know&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479571#M123824</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-19T16:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479573#M123825</link>
      <description>&lt;P&gt;Thanks It working.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479573#M123825</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-07-19T16:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479593#M123829</link>
      <description>&lt;P&gt;Leap year doesn't matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174522"&gt;@rajeshalwayswel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks to both. but the year is leap year in this scenario what would be the solution?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479593#M123829</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T17:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: If day is missing need to represent the day of the month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479758#M123873</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174522"&gt;@rajeshalwayswel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks to both. but the year is leap year in this scenario what would be the solution?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS knows which years are leap years, at least through 19999 the last time looked, and 'e' option in intnx takes that into account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes I said 19999. I had to demonstrate this multiple times during Y2K worries about the data I was storing in SAS. The date formats don't display properly because of the 5-digit year but the date functions work just fine.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 23:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-day-is-missing-need-to-represent-the-day-of-the-month/m-p/479758#M123873</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-19T23:14:45Z</dc:date>
    </item>
  </channel>
</rss>

