<?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: Time format changing when export to CSV in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300801#M312337</link>
    <description>&lt;P&gt;Proc export is going to give you much control.&lt;/P&gt;
&lt;P&gt;If you have SAS 9.4 the EXCEL libname may help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or ODS tagsets.excelxp can create XML data that Excel can read. With proc print you can provide style appearance&amp;nbsp;overrides and the TAGATTR option on specific variables to control how Excel interpret things.&lt;/P&gt;
&lt;P&gt;I seldom get into that as I avoid Excel output as much as possible.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2016 16:19:03 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-09-26T16:19:03Z</dc:date>
    <item>
      <title>Time format changing when export to CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300786#M312334</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my raw data I am using seconds, and I need to format it into mmss. I used hms(0,0,&amp;lt;variable&amp;gt;) in my code, and then used format mmss. This worked properly in my SAS code/table; however, when I export the SAS table to a CSV file, some of the times are being formatted incorrectly (the large times). All of the data is correct in my SAS table, but for some reason when I open the CSV in excel, some of it is no longer accurate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why this might be occurring? I have attached a picture with two samples.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bri&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13007i2C2FFE3ACB27AF21/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SAS.jpg" title="SAS.jpg" /&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300786#M312334</guid>
      <dc:creator>BStenta</dc:creator>
      <dc:date>2016-09-26T15:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Time format changing when export to CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300787#M312335</link>
      <description>&lt;P&gt;Your answer is here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;when I open the CSV in excel, some of it is no longer accurate&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;/U&gt;Excel makes assumptions about values when opening CSV and has been known to change things considerably. Loot at the value in the CSV using a Text program like Notepad or possibly Wordpad and you will see things basically the same as SAS.(unless you have SAVED the file with Excel. In which case re-export the values)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see what display format Excel has assigned to the cell an possibly select one that appears as needed.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300787#M312335</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T15:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time format changing when export to CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300789#M312336</link>
      <description>&lt;P&gt;Thank you! You are right. When I open this file in Notepad, the formatting is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excel is using h:mm for the correct cells, and [h]:mm:ss for the incorrect cells. Is there a way to alter my SAS code so that this does not happen?? I need all the cells to be in the h:mm format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300789#M312336</guid>
      <dc:creator>BStenta</dc:creator>
      <dc:date>2016-09-26T15:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Time format changing when export to CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300801#M312337</link>
      <description>&lt;P&gt;Proc export is going to give you much control.&lt;/P&gt;
&lt;P&gt;If you have SAS 9.4 the EXCEL libname may help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or ODS tagsets.excelxp can create XML data that Excel can read. With proc print you can provide style appearance&amp;nbsp;overrides and the TAGATTR option on specific variables to control how Excel interpret things.&lt;/P&gt;
&lt;P&gt;I seldom get into that as I avoid Excel output as much as possible.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 16:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-format-changing-when-export-to-CSV/m-p/300801#M312337</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T16:19:03Z</dc:date>
    </item>
  </channel>
</rss>

