<?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 problem exporting to excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229922#M268022</link>
    <description>Hello,&lt;BR /&gt;Thank you for your recommendation. I finally finished it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Wed, 14 Oct 2015 15:35:07 GMT</pubDate>
    <dc:creator>Ariel</dc:creator>
    <dc:date>2015-10-14T15:35:07Z</dc:date>
    <item>
      <title>date problem exporting to excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229853#M268018</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nice to meet everyone here. It's my first time to use sas. And I am facing a big prolem now.&lt;/P&gt;&lt;P&gt;I want to export my sas data to excel, and it worked. But the only problem is that my format of date is not correct! But it's correct when I viewed on the sas...I don't know what's wrong with it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 08:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229853#M268018</guid>
      <dc:creator>Ariel</dc:creator>
      <dc:date>2015-10-14T08:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: date problem exporting to excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229856#M268019</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In SAS date is a number, you only see it as a date because you formatted the number as a date.&lt;/P&gt;&lt;P&gt;One solution may be to transform the number in text using &lt;STRONG&gt;put &lt;/STRONG&gt;function (newvar=put(oldvar, date9.) and export the new text variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 08:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229856#M268019</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2015-10-14T08:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: date problem exporting to excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229857#M268020</link>
      <description>&lt;P&gt;How do you export to Excel?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS a date value is stored as a number in a variable of type numeric (there is no type 'date' like in other languages). You then apply a so-called SAS Format to this variable so it "prints" formatted showing a date string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS dates are stored as the number of days since 1Jan1960. Normally when a date format has been assigned to a numeric variable SAS converts the value to the appropriate form required by Excel. It appears this hasn't worked for you and you've got instead the internal numeric values as numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One reason why this could have happened: The date format applied on your SAS dataset has not been an OOTB one. To test the theory you could do the following:&lt;/P&gt;
&lt;P&gt;1: Apply a standard SAS date format to your variables (in below code replace "my_dataset" with the name of your real data set).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set my_dataset;
  format date exci_date date9.;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Download the "want" dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 09:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229857#M268020</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-10-14T09:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: date problem exporting to excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229922#M268022</link>
      <description>Hello,&lt;BR /&gt;Thank you for your recommendation. I finally finished it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-problem-exporting-to-excel/m-p/229922#M268022</guid>
      <dc:creator>Ariel</dc:creator>
      <dc:date>2015-10-14T15:35:07Z</dc:date>
    </item>
  </channel>
</rss>

