<?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 question about csv data before importing into SAS in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205423#M4620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To import excel data into SAS, I usually convert the excel file to csv file. But for a file as attached, when I converted the excel data to csv data, the leading zeros in some observations are missed. Also, some observations with "E" are treated as scientific format, which is not I want. Accordingly, the SAS data generated are as what the csv file shows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the SAS data generated like the data in excel. Please indicate how can I do this? Thanks.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11487i15F825EB62D71CA7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="question.png" title="question.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2015 13:34:05 GMT</pubDate>
    <dc:creator>comeon2012</dc:creator>
    <dc:date>2015-04-28T13:34:05Z</dc:date>
    <item>
      <title>question about csv data before importing into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205423#M4620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To import excel data into SAS, I usually convert the excel file to csv file. But for a file as attached, when I converted the excel data to csv data, the leading zeros in some observations are missed. Also, some observations with "E" are treated as scientific format, which is not I want. Accordingly, the SAS data generated are as what the csv file shows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the SAS data generated like the data in excel. Please indicate how can I do this? Thanks.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11487i15F825EB62D71CA7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="question.png" title="question.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205423#M4620</guid>
      <dc:creator>comeon2012</dc:creator>
      <dc:date>2015-04-28T13:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: question about csv data before importing into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205424#M4621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS will not do what you have described with a CSV file unless you tell it to.&amp;nbsp; Excel will do that unless you force it NOT to.&lt;/P&gt;&lt;P&gt;You have pasted a picture of what looks like an Excel sheet.&lt;/P&gt;&lt;P&gt;Paste a copy of the actual CSV file.&amp;nbsp; Open it with NOTEPAD or other text editor to see what is in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The advantage of using a CSV file to transfer to SAS instead of trying to convert the Excel directly is that you can write you own DATA step to read it.&amp;nbsp; If you want the values to be treated as character then read them into a character variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'myfile.csv' dsd firstobs=2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length Excel $10&amp;nbsp; CSV 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input excel csv ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205424#M4621</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-28T13:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: question about csv data before importing into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205425#M4622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are doing a last step which confuses you.&amp;nbsp;&amp;nbsp; When you save the Excel file to CSV, goto the saved file and right click and open with Notepad.&amp;nbsp; Look at the data there.&amp;nbsp; It will be corrrect.&amp;nbsp; What is happening is you are then opening the CSV in Excel.&amp;nbsp; Excel has a&amp;nbsp; "feature" that when it reads data, it interprets what it sees and because of the E which is for exponent it converts to number.&amp;nbsp; Ensure, in your SAS progam, when you read it in that you datastep input states character and it should work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another good reason not to use Excel for anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205425#M4622</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-28T13:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: question about csv data before importing into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205426#M4623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom and RW9. I have resolved the problem according to your suggestions. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 02:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/question-about-csv-data-before-importing-into-SAS/m-p/205426#M4623</guid>
      <dc:creator>comeon2012</dc:creator>
      <dc:date>2015-05-17T02:41:51Z</dc:date>
    </item>
  </channel>
</rss>

