<?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: SAS import excel problem(got 255 columns,usless empty columns read) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308412#M66183</link>
    <description>&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Have you tried using the libname approach? I created a bunch of columns, then deleted the data from them to attempt to simulate your issue. I saved the file as test.xlsx. make sure you clear the libname connection or you cannot access the excel file. more info is provided in the base Sas 1 course.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; xl pcfiles path=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;Mypath\test.xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; STuffInTest; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; xl.'Sheet1$'n; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* must use literal for sheet name */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; xl &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;clear&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2016 01:50:25 GMT</pubDate>
    <dc:creator>KRusso</dc:creator>
    <dc:date>2016-11-01T01:50:25Z</dc:date>
    <item>
      <title>SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308300#M66140</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use proc import to read excel .xlsx file.&lt;/P&gt;
&lt;P&gt;there are total 25 column in the excel.but after I read it into SAS, it cost me longer time and read a 255 column SAS data set ,&lt;/P&gt;
&lt;P&gt;230 columns are empty. I don't know what problem is this. this happend on some special excel file while other excel files don't have problem.&lt;/P&gt;
&lt;P&gt;I can't see any different among these excel files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 15:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308300#M66140</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-10-31T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308302#M66141</link>
      <description>&lt;P&gt;Try using the range option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; RANGE='A13:D113';&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Oct 2016 15:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308302#M66141</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2016-10-31T15:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308307#M66144</link>
      <description>the range works but is it necessary? the excel only has 25 columns&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 31 Oct 2016 16:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308307#M66144</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-10-31T16:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308308#M66145</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Adjust the range to fit what you want. For 25 columns, it would be A &amp;lt;whatever&amp;gt;: Y&amp;lt;whatever&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 16:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308308#M66145</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2016-10-31T16:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308319#M66147</link>
      <description>&lt;P&gt;Note that Excel will occasionally treat a column as having "something" even after deleting the data in the columns.&lt;/P&gt;
&lt;P&gt;You didn't say how you read the data into SAS but many of the approaches rely on Excel telling SAS about the contents. When Excel has "ghost" columns then they get imported.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing you might try is exporting the file to CSV and see if you get hundreds of commas as the end of each line when you look at the exported file with a text editor or something like Wordpad. If so, then you have ghost columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel will also do this with rows.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 16:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308319#M66147</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-31T16:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308342#M66159</link>
      <description>&lt;P&gt;There's a function in Excel that moves the cursor to the "last" cell, which will show you what Excel thinks is the maximum used column and row.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308342#M66159</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-31T18:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308412#M66183</link>
      <description>&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Have you tried using the libname approach? I created a bunch of columns, then deleted the data from them to attempt to simulate your issue. I saved the file as test.xlsx. make sure you clear the libname connection or you cannot access the excel file. more info is provided in the base Sas 1 course.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; xl pcfiles path=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;Mypath\test.xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; STuffInTest; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; xl.'Sheet1$'n; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* must use literal for sheet name */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; xl &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;clear&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 01:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308412#M66183</guid>
      <dc:creator>KRusso</dc:creator>
      <dc:date>2016-11-01T01:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308739#M66292</link>
      <description>&lt;P&gt;The libname method is very good but I have SAS 9.4(even 9.3)) which not support this method.(I knew only 9.2 support this)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 12:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308739#M66292</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-11-02T12:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308745#M66295</link>
      <description>I am current using libname statement in 9.4. libname mylib pcfiles path="&amp;amp;BalFldr&amp;amp;ReturnChecks.";&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13103iC68A3B3D1111FF8B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SAS_version.PNG" title="SAS_version.PNG" /&gt;</description>
      <pubDate>Wed, 02 Nov 2016 13:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308745#M66295</guid>
      <dc:creator>KRusso</dc:creator>
      <dc:date>2016-11-02T13:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308815#M66328</link>
      <description>&lt;P&gt;I tried with your mothod, it works! you add pcfiles engine so that works!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;while my old method not work&amp;nbsp; at 9.4 but works at 9.2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAME&amp;nbsp;Myfile1&amp;nbsp;"C:temp\test.xlsx";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 18:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308815#M66328</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-11-02T18:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import excel problem(got 255 columns,usless empty columns read)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308819#M66329</link>
      <description>&lt;P&gt;SAS 9.4 can use engines to read/write XLSX and XLS file directly on both Unix and Windows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib xlsx 'myfile.xlsx';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 18:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-import-excel-problem-got-255-columns-usless-empty-columns/m-p/308819#M66329</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-11-02T18:30:06Z</dc:date>
    </item>
  </channel>
</rss>

