<?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 How to convert numeric date to sasdate ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24861#M5605</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for quick response. I am getting error "Variable mydate has been defined as both character and numeric"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have variable "mydate" in a dataset, I am not passing inline data using cards statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I did proc datasets on my dataset, I see variable as character type with length as 30. Any insight what's wrong I am doing in here ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2012 20:07:31 GMT</pubDate>
    <dc:creator>sasbasls</dc:creator>
    <dc:date>2012-01-05T20:07:31Z</dc:date>
    <item>
      <title>How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24859#M5603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable in a dataset with value like "ccyy-mm-dd" as character. How can I convert to date ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used input(date,yymmdd10.);, but using this I am still getting variable type as character with a value like a numeric number, not date value. Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 19:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24859#M5603</guid>
      <dc:creator>sasbasls</dc:creator>
      <dc:date>2012-01-05T19:44:58Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24860#M5604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why you are running into a problem.&amp;nbsp; The following works for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input date $10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;2011-01-01&lt;/P&gt;&lt;P&gt;2011-01-02&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; format date date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have (rename=(date=_date));&lt;/P&gt;&lt;P&gt;&amp;nbsp; date=input(_date,yymmdd10.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 19:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24860#M5604</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-05T19:50:59Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24861#M5605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for quick response. I am getting error "Variable mydate has been defined as both character and numeric"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have variable "mydate" in a dataset, I am not passing inline data using cards statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I did proc datasets on my dataset, I see variable as character type with length as 30. Any insight what's wrong I am doing in here ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 20:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24861#M5605</guid>
      <dc:creator>sasbasls</dc:creator>
      <dc:date>2012-01-05T20:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24862#M5606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same as my example.&amp;nbsp; You can't change a variable from character to numeric, but you can rename it and create a new variable with the old variable name, and drop the old variable.&amp;nbsp; So, using the same example, assuming your current data are in a SAS dataset called have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;data want (drop=_:);&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; format date date9.;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; set have (rename=(mydate=_mydate));&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; date=input(_mydate,yymmdd10.);&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 20:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24862#M5606</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-05T20:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24863#M5607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; mydate &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;$10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;2011-01-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;2011-01-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; want (drop=_:);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; mydate &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have (rename=(mydate=_mydate));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; mydate=input(_mydate,&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;contents&lt;/STRONG&gt;; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 20:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24863#M5607</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-05T20:45:21Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24864#M5608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you art297, it worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 02:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24864#M5608</guid>
      <dc:creator>sasbasls</dc:creator>
      <dc:date>2012-01-06T02:25:07Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24865#M5609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 02:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24865#M5609</guid>
      <dc:creator>sasbasls</dc:creator>
      <dc:date>2012-01-06T02:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24866#M5610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;p.s.&amp;nbsp; Linlin .. Thanks for correcting my typo!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 02:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24866#M5610</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-06T02:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to sasdate ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24867#M5611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art,&lt;/P&gt;&lt;P&gt;you are more than welcome. Thank you for your contribution to the forum. I have learned a lot from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 12:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-date-to-sasdate/m-p/24867#M5611</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-06T12:20:41Z</dc:date>
    </item>
  </channel>
</rss>

