<?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: Importing data from Excel--only first 255 columns brought in in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343313#M63369</link>
    <description>Thank you for the suggestion! Unfortunately this didn't work while the DBMS = EXCEL. It still only took the first 255 columns. Once I changed the code to use XLSX the range option wasn't needed.</description>
    <pubDate>Wed, 22 Mar 2017 15:14:38 GMT</pubDate>
    <dc:creator>rchd</dc:creator>
    <dc:date>2017-03-22T15:14:38Z</dc:date>
    <item>
      <title>Importing data from Excel--only first 255 columns brought in</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343157#M63364</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS and am having trouble getting my data into SAS from Excel. I have tried it with both libname and proc import&amp;nbsp;(code below) and both sort of&amp;nbsp;work (e.g., I get no errors), but neither brings in the entire data set, just the first 255 columns. I have re-ordered the columns in the Excel file, made sure all variables were formatted as numbers in the Excel file, and made sure that all missing values are indicated by a dot with no effect. The original data has 2970 rows and 412 columns. So far I get a SAS dataset with 2970 rows but only 255 columns. The Excel file has several sheets in it but the only one I need is the one called "Data". Also, I assembled&amp;nbsp;the data in the Excel&amp;nbsp;file myself and have used&amp;nbsp;it in Stata, so I am confident that there are not weird formatting things in it (like non-numerical values mixed with numbers, or incompatible variable names). I am using SAS 9.4 for Windows (32 bit), SAS Enterprise Guide 7.1 (64-bit) and Excel 2016 if that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how can I get my entire dataset into SAS from Excel? I realize that it is possible to import data in other formats, but I do a lot of work in Excel and it would be really convenient to be able to import from Excel directly, and everything I have read says that it is possible to do so, and it seems like I am really close to getting it to work. What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;~Riva&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two bits of code that give me exactly the same result:&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fsafrica excel 'C:\Users\...\FS Africa Dataset 1960-2014.xlsx' mixed=yes;
	Options validVarName=any; 
data fsdata; 
set fsafrica."Data$"n; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='C:\Users\...\FS Africa Dataset 1960-2014.xlsx'
	DBMS=EXCEL replace out=fsafrica;
	sheet="Data$"n;
	getnames=yes;
data fsdata; &lt;BR /&gt;set fsafrica; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 02:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343157#M63364</guid>
      <dc:creator>rchd</dc:creator>
      <dc:date>2017-03-22T02:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Importing data from Excel--only first 255 columns brought in</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343158#M63365</link>
      <description>&lt;P&gt;What version of SAS are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change the DBMS to XLSX in either methods should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need sample code, search on here&amp;nbsp;for this topic (Excel, 255 columns) and there are examples within the last month for sure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Saw that you inciuded your SAS version, changing the DBMS to XLSX will fix the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 03:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343158#M63365</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-22T03:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Importing data from Excel--only first 255 columns brought in</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343165#M63366</link>
      <description>&lt;P&gt;try range= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='C:\Users\...\FS Africa Dataset 1960-2014.xlsx'
	DBMS=EXCEL replace out=fsafrica;
	RANGE="Data$A1:Z100";
	getnames=yes;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Mar 2017 03:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343165#M63366</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-22T03:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Importing data from Excel--only first 255 columns brought in</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343308#M63368</link>
      <description>&lt;P&gt;Thank you, Reeza! That worked&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://communities.sas.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the reference of others I also had to change the way I called the sheet (namely removing the $ at the end), otherwise I got an error saying that the sheet didn't exist or could not be found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The working code now looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fsafrica XLSX 'C:\Users\...\FS Africa Dataset 1960-2014.xlsx';
	Options validVarName=any; 
data fsdata; 
set fsafrica.Data; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='C:\Users\...\FS Africa Dataset 1960-2014.xlsx'
	DBMS=XLSX replace out=fsafrica;
	sheet="Data"n;
	getnames=yes;
data fsdata; 
set fsafrica; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Obviously I will just pick one bit of code to use but now I know how to do it both ways&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 15:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343308#M63368</guid>
      <dc:creator>rchd</dc:creator>
      <dc:date>2017-03-22T15:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Importing data from Excel--only first 255 columns brought in</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343313#M63369</link>
      <description>Thank you for the suggestion! Unfortunately this didn't work while the DBMS = EXCEL. It still only took the first 255 columns. Once I changed the code to use XLSX the range option wasn't needed.</description>
      <pubDate>Wed, 22 Mar 2017 15:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-data-from-Excel-only-first-255-columns-brought-in/m-p/343313#M63369</guid>
      <dc:creator>rchd</dc:creator>
      <dc:date>2017-03-22T15:14:38Z</dc:date>
    </item>
  </channel>
</rss>

