<?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: Unique identifiers keeps converting to a date when exporting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unique-identifiers-keeps-converting-to-a-date-when-exporting/m-p/628322#M185634</link>
    <description>&lt;P&gt;Blame it on Excel.&lt;/P&gt;
&lt;P&gt;It will do strange things with values with dashes. Export to CSV and do NOT open in Excel, use something like Wordpad&amp;nbsp;and you will see the values are fine. If you open in Excel and then save the csv the contents will change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Changing properties in an XLSX before Export does not have any impact because the Proc Export is replacing the file. That is what the option REPLACE does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try ODS EXCEL as the destination and use Proc Print instead of Export if you must look at it Excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data junk;
   x='10-8880';
run;

ods excel file="x:\junk.xlsx";
proc print data=junk;
run;
ods excel close;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Feb 2020 20:26:06 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-02-28T20:26:06Z</dc:date>
    <item>
      <title>Unique identifiers keeps converting to a date when exporting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unique-identifiers-keeps-converting-to-a-date-when-exporting/m-p/628306#M185632</link>
      <description>&lt;P&gt;I have a file that has unique identifiers that are in the format "nn-nnnn", however, everytime I export the file to CSV or XLSX using proc export, the unique identifiers for some keep converting to a date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example: The unique identifier "10-8806" keeps converting to a date "10/1/8806".&amp;nbsp; I've tried formatting the columns in excel to "Text" before exporting and that doesn't seem to work.&amp;nbsp; Is there an option I should be including in the proc export to prevent the identifier from converting to a date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export data=defn&lt;BR /&gt;DBMS=XLSX REPLACE LABEL&lt;BR /&gt;OUTFILE="C:\Users\roster.XLSX";&lt;BR /&gt;SHEET="Roster";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 19:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unique-identifiers-keeps-converting-to-a-date-when-exporting/m-p/628306#M185632</guid>
      <dc:creator>erikawashere</dc:creator>
      <dc:date>2020-02-28T19:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unique identifiers keeps converting to a date when exporting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unique-identifiers-keeps-converting-to-a-date-when-exporting/m-p/628322#M185634</link>
      <description>&lt;P&gt;Blame it on Excel.&lt;/P&gt;
&lt;P&gt;It will do strange things with values with dashes. Export to CSV and do NOT open in Excel, use something like Wordpad&amp;nbsp;and you will see the values are fine. If you open in Excel and then save the csv the contents will change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Changing properties in an XLSX before Export does not have any impact because the Proc Export is replacing the file. That is what the option REPLACE does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try ODS EXCEL as the destination and use Proc Print instead of Export if you must look at it Excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data junk;
   x='10-8880';
run;

ods excel file="x:\junk.xlsx";
proc print data=junk;
run;
ods excel close;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 20:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unique-identifiers-keeps-converting-to-a-date-when-exporting/m-p/628322#M185634</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-28T20:26:06Z</dc:date>
    </item>
  </channel>
</rss>

