<?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: Removing Exponents while creating CSV file using ODS CSV in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233024#M42516</link>
    <description>&lt;P&gt;If you open your CSV file in NOTEPAD you will see that it is perfectly OK. The problem is Excel is applying formatting to the CSV when you open it and sometimes it doesn't get it right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can fix the formatting in Excel by setting the data type on those columns as text. If that doesn't work then do a DATA IMPORT into Excel rather than just open the CSV and specify the data type of the long numeric columns as text.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2015 08:39:24 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2015-11-04T08:39:24Z</dc:date>
    <item>
      <title>Removing Exponents while creating CSV file using ODS CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233020#M42515</link>
      <description>Hi,

I am creating a semicolon seperated CSV file using ODS CSV.
Numeric column which is phone number and 15 digits long are being displayed as exponents in CSV file(opening using MS Excel).
Also I have one character column which holds numeric value which is 20-25 digits , even that column is displayed as exponents in CSV file(opening using MS Excel).

Please find the code below which I am using:

ods csv file="&amp;amp;FileLoc.&amp;amp;FileName..csv" options(delimiter=";");
Options missing='';

proc report data=INVOICE_NOVAT split='#' ls=255;
columns ( PHONE_NUMBER USER_NAME USER_REFERENCE1 
USER_REFERENCE2 USER_REFERENCE3 
YEAR MONTH INVOICE_ID FEES_NET DOMESTIC_USAGE_NET);

define PHONE_NUMBER/display 'Subscription' ;
define USER_NAME/display 'User';
define USER_REFERENCE1/display 'User reference 1';
define USER_REFERENCE2/display 'User reference 2';
define USER_REFERENCE3/display 'User reference 3';
define YEAR/display 'Year';
define MONTH/display 'Month';
define INVOICE_ID/display 'Invoice Number' ;
define FEES_NET/display 'Fees';
define DOMESTIC_USAGE_NET/display 'Domestic usage (speech/SMS/MMS/data)';


run;
ods csv close;


Examples:
INVOICE_ID : 5504694476130
PHONE_NUMBER : 580000404271


Your help is highly appreciated.</description>
      <pubDate>Wed, 04 Nov 2015 06:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233020#M42515</guid>
      <dc:creator>DeepikaM</dc:creator>
      <dc:date>2015-11-04T06:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Exponents while creating CSV file using ODS CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233024#M42516</link>
      <description>&lt;P&gt;If you open your CSV file in NOTEPAD you will see that it is perfectly OK. The problem is Excel is applying formatting to the CSV when you open it and sometimes it doesn't get it right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can fix the formatting in Excel by setting the data type on those columns as text. If that doesn't work then do a DATA IMPORT into Excel rather than just open the CSV and specify the data type of the long numeric columns as text.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 08:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233024#M42516</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-11-04T08:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Exponents while creating CSV file using ODS CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233028#M42517</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes thats correct.&lt;/P&gt;
&lt;P&gt;But I want a solution which we can apply in SAS code which I gave above.&lt;/P&gt;
&lt;P&gt;So that when the CSV file is created , we will be able to see the number without exponents(original value)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any possible solution which can be applied in ODS CSV or PROC REPORT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 09:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233028#M42517</guid>
      <dc:creator>DeepikaM</dc:creator>
      <dc:date>2015-11-04T09:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Exponents while creating CSV file using ODS CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233029#M42518</link>
      <description>&lt;P&gt;Try Google, paste "site:sas.com excel leading zeros" (without quotes) in the search-box.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233029#M42518</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2015-11-04T10:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Exponents while creating CSV file using ODS CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233033#M42520</link>
      <description>&lt;P&gt;You cannot do that with CSV. &amp;nbsp;Simple put CSV is a text based format, that when opened in Excel, is parsed and interpreted by the Excel engine in its own way - another reason why you should not be using Excel for anything! &amp;nbsp;If you have to open output in Excel, then you will need to change your output format to tagsets.excelxp and add in the specific foramts which Excel should apply to each column. &amp;nbsp;You can find examples of this here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings11/266-2011.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As SASKiwi has already told you, the problem is Excel, not SAS or the CSV file, it is the engine that Excel uses to read the CSV file. &amp;nbsp;If you open the CSV file in anything other than Excel you will see the file is correct (assuming your export code is correct).&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Exponents-while-creating-CSV-file-using-ODS-CSV/m-p/233033#M42520</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-04T10:14:52Z</dc:date>
    </item>
  </channel>
</rss>

