<?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: proc import xlsx with variable name at obs=5 dand data at obs=6 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768641#M39560</link>
    <description>&lt;P&gt;On second thought, I see that you try to use a SAS name literal as a sheet name (something you would do if you used LIBNAME XLSX and the sheet as a pseudo-dataset).&lt;/P&gt;
&lt;P&gt;But so, the RANGE statement will resolve to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;range="&lt;SPAN&gt;'hyfi prm cnts'n&lt;/SPAN&gt;$A5:S500";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and I have doubts that this will work unless the sheet is actually named&amp;nbsp;&lt;SPAN&gt;'hyfi prm cnts'n (including the quotes and the trailing n).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Sep 2021 19:37:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-09-20T19:37:52Z</dc:date>
    <item>
      <title>proc import xlsx with variable name at obs=5 dand data at obs=6</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768626#M39555</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to proc import an Excel file (xlsx), but I am not able to properly import the variable names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let sname1='hyfi prm cnts'n;&lt;BR /&gt;PROC IMPORT&lt;BR /&gt;DATAFILE='/.../Inforce_N_Hyfi_count02JUL21.xlsx'&lt;BR /&gt;OUT=test&lt;BR /&gt;DBMS=xlsx&lt;BR /&gt;REPLACE;&lt;BR /&gt;SHEET="&amp;amp;sname1.";&lt;BR /&gt;range="&amp;amp;sname1.$A5:S500";&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The range option is not working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 18:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768626#M39555</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2021-09-20T18:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc import xlsx with variable name at obs=5 dand data at obs=6</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768628#M39556</link>
      <description>&lt;P&gt;What happens when you omit the SHEET= statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My personal solution would be to save the data to a delimited (comma, tab, whatever) text file and read that with a data step.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 18:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768628#M39556</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-20T18:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc import xlsx with variable name at obs=5 dand data at obs=6</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768632#M39557</link>
      <description>&lt;P&gt;%let sname1='hyfi prm cnts'n;&lt;BR /&gt;PROC IMPORT&lt;BR /&gt;DATAFILE='/.../Inforce_N_Hyfi_count02JUL21.xlsx'&lt;BR /&gt;OUT=test&lt;BR /&gt;DBMS=xlsx&lt;BR /&gt;REPLACE;&lt;BR /&gt;/* SHEET="&amp;amp;sname1.";*/&lt;BR /&gt;range="&amp;amp;sname1.$A5:S500";&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Couldn't find sheet in spreadsheet&lt;BR /&gt;Requested Input File Is Invalid&lt;BR /&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 19:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768632#M39557</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2021-09-20T19:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc import xlsx with variable name at obs=5 dand data at obs=6</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768633#M39558</link>
      <description>&lt;P&gt;Excel is not going like that letter N in the RANGE setting.&amp;nbsp; You don't have to set the end of the range, just the upper left corner.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT DATAFILE='/.../Inforce_N_Hyfi_count02JUL21.xlsx'
  DBMS=xlsx
  OUT=test REPLACE
;
  RANGE="'&lt;SPAN&gt;hyfi prm cnts'&lt;/SPAN&gt;$A5:";
  GETNAMES=YES;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Sep 2021 19:16:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768633#M39558</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-20T19:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc import xlsx with variable name at obs=5 dand data at obs=6</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768635#M39559</link>
      <description>&lt;P&gt;Syntax such as the following should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let sname=sheet1$;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile = C:\myfiles\Excel Files\class.xlsx"&lt;BR /&gt;out = test&lt;/P&gt;
&lt;P&gt;dbms = xlsx replace;&lt;BR /&gt;range = "&amp;amp;sname.A5:E30";&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 19:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768635#M39559</guid>
      <dc:creator>jebjur</dc:creator>
      <dc:date>2021-09-20T19:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc import xlsx with variable name at obs=5 dand data at obs=6</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768641#M39560</link>
      <description>&lt;P&gt;On second thought, I see that you try to use a SAS name literal as a sheet name (something you would do if you used LIBNAME XLSX and the sheet as a pseudo-dataset).&lt;/P&gt;
&lt;P&gt;But so, the RANGE statement will resolve to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;range="&lt;SPAN&gt;'hyfi prm cnts'n&lt;/SPAN&gt;$A5:S500";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and I have doubts that this will work unless the sheet is actually named&amp;nbsp;&lt;SPAN&gt;'hyfi prm cnts'n (including the quotes and the trailing n).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 19:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-import-xlsx-with-variable-name-at-obs-5-dand-data-at-obs-6/m-p/768641#M39560</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-20T19:37:52Z</dc:date>
    </item>
  </channel>
</rss>

