<?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: I need to import the attached .xls file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142837#M38003</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The most obvious problem is that your program is reading a CSV file and you posted an XLS file.&amp;nbsp; XLS is a binary format that Microsoft uses for Excel spreadsheets.&amp;nbsp; CSV is a plain text with one line per observation and commas between the variables.&amp;nbsp; If you open the XLS file in Excel you can try to save it as a CSV file and then perhaps your SAS program will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Sep 2014 17:37:19 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-09-12T17:37:19Z</dc:date>
    <item>
      <title>I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142836#M38002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to import the attached file into SAS.&amp;nbsp; I am using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data per.a1;&lt;/P&gt;&lt;P&gt;infile "/home/mit/mahler/mahler/Conf_Call_Hist_*.xls" dlm=',' DSD missover lrecl=32767 firstobs=2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;informat companyid $12. ;&lt;/P&gt;&lt;P&gt;informat ticker $6. ;&lt;/P&gt;&lt;P&gt;informat company_name $44. ;&lt;/P&gt;&lt;P&gt;informat quarter $4. ;&lt;/P&gt;&lt;P&gt;informat fiscal_year $7. ;&lt;/P&gt;&lt;P&gt;informat date $12.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format companyid $12.;&lt;/P&gt;&lt;P&gt;format ticker $6. ;&lt;/P&gt;&lt;P&gt;format company_name $44. ;&lt;/P&gt;&lt;P&gt;format quarter $4. ;&lt;/P&gt;&lt;P&gt;format fiscal_year $7. ;&lt;/P&gt;&lt;P&gt;format date $12.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;companyid&amp;nbsp; $&lt;/P&gt;&lt;P&gt;ticker $&lt;/P&gt;&lt;P&gt;company_name $&lt;/P&gt;&lt;P&gt;quarter $&lt;/P&gt;&lt;P&gt;fiscal_year $&lt;/P&gt;&lt;P&gt;date $ ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I have already assigned the library "per"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting a dataset to come out but it is just a bunch of symbols.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 16:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142836#M38002</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-09-12T16:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142837#M38003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The most obvious problem is that your program is reading a CSV file and you posted an XLS file.&amp;nbsp; XLS is a binary format that Microsoft uses for Excel spreadsheets.&amp;nbsp; CSV is a plain text with one line per observation and commas between the variables.&amp;nbsp; If you open the XLS file in Excel you can try to save it as a CSV file and then perhaps your SAS program will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 17:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142837#M38003</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-12T17:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142838#M38004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry, that was just because I pasted the latest version of my code and a less recent version of the spreadsheet.&amp;nbsp; I have tried saving the file as a .csv file and as an .xls file and then called the same thing in the infile statement.&amp;nbsp; Neither has worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always make sure that they match.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the above code with an .xls file, using "," as my delimiter, I get a file out with observations and variables, but they are symbols and most of the variables are blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 18:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142838#M38004</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-09-12T18:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142839#M38005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please re-read what I wrote.&amp;nbsp; It should fully explain why you are seeing strange characters instead of normal alphanumeric characters.&lt;/P&gt;&lt;P&gt;If you want SAS to read an actual XLS file then you will need to use PROC IMPORT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 18:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142839#M38005</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-12T18:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142840#M38006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't read an XLS file with a data step infile statement, you need a proc import. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read a CSV file with a data infile statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 19:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142840#M38006</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-12T19:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142841#M38007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I save it as a .csv file and try to use the same code above, instead calling the .csv version of the file, I get a dataset with 0 observations.&amp;nbsp; Is there some other way that I am supposed to be converting this to a .csv file other than just saving it as a .csv file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried to use proc import using the following code, or some variation of it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc import datafile="/home/mit/mahler/mahler/Conf_Call_Hist_*.csv"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=per.a1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames= yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no idea why this is not working...&amp;nbsp; I have imported these files before without any problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 19:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142841#M38007</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-09-12T19:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142842#M38008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="255172" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&amp;nbsp; I have tried to save it as a .csv file and rerun the code, and simply changing the infile statement, but that doesn't work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried to use proc import, as seen in the comment above, using both the .xls and the .csv form of the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 19:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142842#M38008</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-09-12T19:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: I need to import the attached .xls file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142843#M38009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok guys, thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just figured it out with the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc import datafile="/home/mit/mahler/mahler/Conf_Call_Hist_*.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=per.a2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=xls&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames= yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 19:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/I-need-to-import-the-attached-xls-file/m-p/142843#M38009</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-09-12T19:13:10Z</dc:date>
    </item>
  </channel>
</rss>

