<?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 converting character date to numeric date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635076#M188531</link>
    <description>&lt;P&gt;i have a variable "date" which contains dates whose formats are in $11. But i want those in format YYYY-MM-DD.how to do this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example the dates are like Apr 01 2019, i want it to be like 2019-04-01.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2020 16:16:05 GMT</pubDate>
    <dc:creator>TANMOY05</dc:creator>
    <dc:date>2020-03-26T16:16:05Z</dc:date>
    <item>
      <title>converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635076#M188531</link>
      <description>&lt;P&gt;i have a variable "date" which contains dates whose formats are in $11. But i want those in format YYYY-MM-DD.how to do this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example the dates are like Apr 01 2019, i want it to be like 2019-04-01.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635076#M188531</guid>
      <dc:creator>TANMOY05</dc:creator>
      <dc:date>2020-03-26T16:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635079#M188533</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;numeric_date=(input(char_date,anydtdte.));
format numeric_date yymmddd10.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635079#M188533</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-26T16:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635083#M188534</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304794"&gt;@TANMOY05&lt;/a&gt;&amp;nbsp; Please offer the credit to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; whose original solution is the right one. I would like to point a very minor typo that the default length that anydtdte. informat&amp;nbsp; would read is 9 bytes. I am afraid the typo needs to be corrected by specifying 11. as suffix to make it work without errors&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
char_date='Apr 01 2019';
sas_date=input(char_date,anydtdte11.);
format sas_date date9.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635083#M188534</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-26T16:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635086#M188536</link>
      <description>&lt;P&gt;That's very gracious,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;! Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, your code has a typo as well. I think it should say&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format sas_date yymmddd10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;otherwise the stated output desired is not achieved.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635086#M188536</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-26T16:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635088#M188538</link>
      <description>&lt;P&gt;Hahaha, I blame the Dunkin coffee. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; or I must admit I am noticing my hair growing grey, joining the elders club .hahahahahahha&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:39:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635088#M188538</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-26T16:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: converting character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635117#M188552</link>
      <description>haha, I would give credit to both of you. Both of your solutions helped to solve my problem. Both of you are great guys. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 26 Mar 2020 18:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-character-date-to-numeric-date/m-p/635117#M188552</guid>
      <dc:creator>TANMOY05</dc:creator>
      <dc:date>2020-03-26T18:31:59Z</dc:date>
    </item>
  </channel>
</rss>

