<?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 convert numeric date to SAS date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327489#M73063</link>
    <description>&lt;P&gt;Thanks Jag! I run the following codes and it worked well.&lt;/P&gt;&lt;P&gt;data&amp;nbsp;survey;&lt;/P&gt;&lt;P&gt;set survey;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format survey_date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2017 19:01:02 GMT</pubDate>
    <dc:creator>Therain</dc:creator>
    <dc:date>2017-01-25T19:01:02Z</dc:date>
    <item>
      <title>How to convert numeric date to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327227#M72978</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS 9.4 and I have a variable "surveydate" (23AUG2011). Its length is 8, formats and informats are date9. and its type is numeric. Does anyone can tell me how to convert it to a SAS date so it shows "18862" instead of "23AUG2011"? I tried the following codes but it does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;survey;&lt;/P&gt;&lt;P&gt;set survey;&lt;/P&gt;&lt;P&gt;survey_date=input(surveydate,date9.);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 00:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327227#M72978</guid>
      <dc:creator>Therain</dc:creator>
      <dc:date>2017-01-25T00:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327231#M72979</link>
      <description>&lt;P&gt;I believe it is associated with the format, please remove the format as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data&amp;nbsp;survey;&lt;/P&gt;
&lt;P&gt;set survey;&lt;/P&gt;
&lt;P&gt;survey_date=input(surveydate,date9.);&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;format survey_date;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 01:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327231#M72979</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-01-25T01:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327232#M72980</link>
      <description>&lt;P&gt;It is already is a number, in particular the number of days since 01JAN1960. It only looks to you like it is a date because you told SAS to use the DATE9. format to display it. &amp;nbsp;Either remove the format or attach different&amp;nbsp;one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   surveydate = '23aug2011'd ;
   put surveydate date9. ;
   put surveydate f9.;
   put surveydate comma9. ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jan 2017 01:22:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327232#M72980</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-01-25T01:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327489#M73063</link>
      <description>&lt;P&gt;Thanks Jag! I run the following codes and it worked well.&lt;/P&gt;&lt;P&gt;data&amp;nbsp;survey;&lt;/P&gt;&lt;P&gt;set survey;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format survey_date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 19:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327489#M73063</guid>
      <dc:creator>Therain</dc:creator>
      <dc:date>2017-01-25T19:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric date to SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327490#M73064</link>
      <description>&lt;P&gt;Thanks Tom! Your codes convert 23aug2011 into 18820 successfully and it is shown in the log.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 19:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-date-to-SAS-date/m-p/327490#M73064</guid>
      <dc:creator>Therain</dc:creator>
      <dc:date>2017-01-25T19:02:44Z</dc:date>
    </item>
  </channel>
</rss>

