<?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: excel engine to import excel  into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607641#M176694</link>
    <description>&lt;P&gt;I mean check the right sheet name .&lt;/P&gt;
&lt;P&gt;Maybe&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'S1$'n&lt;/P&gt;
&lt;P&gt;should be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'S1&amp;nbsp; &amp;nbsp; &amp;nbsp; $'n&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select nliter(memname)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;from dictionary.tables&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where libname='WWE';&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 12:00:51 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-11-27T12:00:51Z</dc:date>
    <item>
      <title>excel engine to import excel  into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607611#M176676</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am trying to learn using Excel engine to import Excel table into sas data set.&lt;/P&gt;
&lt;P&gt;I will show&amp;nbsp; 3 examples.&lt;/P&gt;
&lt;P&gt;First example is working well.&lt;/P&gt;
&lt;P&gt;Example1-&lt;/P&gt;
&lt;P&gt;Here there is XLSX file&amp;nbsp; that contain one sheet.&lt;/P&gt;
&lt;P&gt;It is working well with no errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xl   XLSX     "/path/cars_Hybrid.xlsx"; 
data cars_Hybrid;
set xl.cars_Hybrid;
run;

libname xl clear;
/*Import excel file called cars_Hybrid.xlsx
 and create sas data set called cas_Hybrid */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example2-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here there is XLS file that contain one sheet.&lt;/P&gt;
&lt;P&gt;I get an error "ERROR: File XL.class11.DATA does not exist."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname    xl     XLSX     "/path/class11.xls"; 
data class11;
  set xl.class11;
run;
libname xl clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example3-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here there is XLS file that contain multiple sheets.&lt;/P&gt;
&lt;P&gt;I want to import into sas only sheet called&amp;nbsp; "USA"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname      xl    XLSX      "/path/MultiSheet1.XLS"; 
data cars_Hybrid;
  set xl.'USA$'n;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get an error "ERROR: File XL.'USA$'n.DATA does not exist."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607611#M176676</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-11-27T10:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: excel engine to import excel  into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607626#M176687</link>
      <description>&lt;P&gt;Check Sheet name by&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt;      xl    XLSX      &lt;SPAN class="token string"&gt;"/path/MultiSheet1.XLS"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;BR /&gt;proc contents data=xl._all_;&lt;BR /&gt;run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or try dictionary table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select memname&lt;/P&gt;
&lt;P&gt;&amp;nbsp;from dictionary.tables&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where libname='XL';&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And check if it contains trailing blanks .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 11:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607626#M176687</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-27T11:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: excel engine to import excel  into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607634#M176691</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;Please find a full example.&lt;/P&gt;
&lt;P&gt;In xlsx file there are 3 sheets:S1,S2,S3 and I want to import only sheet "S1" into SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc export data=Sashelp.Class 
file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/TYOTA2/RRR.xlsx"
dbms=xlsx;
sheet='S1';

proc export data=sashelp.cars
file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/TYOTA2/RRR.xlsx" 
dbms=xlsx;
sheet='S2';

proc export data=Sashelp.Shoes 
file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/TYOTA2/RRR.xlsx" 
dbms=xlsx; 
sheet='S3';
run;


libname   www    XLSX     "/path/RRR.xlsx"; 
proc contents data=www._all_;
run;


data RRR_Sheet1;
  set www.'S1$'n;;
run;

/*ERROR: Couldn't find range or sheet in spreadsheet*/
/*ERROR: File WWW.'S1$'n.DATA does not exist.*/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 11:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607634#M176691</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-11-27T11:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: excel engine to import excel  into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607641#M176694</link>
      <description>&lt;P&gt;I mean check the right sheet name .&lt;/P&gt;
&lt;P&gt;Maybe&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'S1$'n&lt;/P&gt;
&lt;P&gt;should be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'S1&amp;nbsp; &amp;nbsp; &amp;nbsp; $'n&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select nliter(memname)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;from dictionary.tables&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where libname='WWE';&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 12:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607641#M176694</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-27T12:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: excel engine to import excel  into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607649#M176696</link>
      <description>&lt;P&gt;You're outsmarting yourself. You used valid SAS names for the sheets on export, so use them again for import:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let exfil=/folders/myfolders/test.xlsx;

proc export
  data=sashelp.class 
  file="&amp;amp;exfil"
  dbms=xlsx
  replace
;
sheet='S1';

proc export
  data=sashelp.cars
  file="&amp;amp;exfil" 
  dbms=xlsx
  replace
;
sheet='S2';

proc export
  data=sashelp.shoes 
  file="&amp;amp;exfil" 
  dbms=xlsx
  replace
; 
sheet='S3';
run;

libname www xlsx "&amp;amp;exfil";

proc contents data=www._all_;
run;

data RRR_Sheet1;
  set www.S1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt; 73         %let exfil=/folders/myfolders/test.xlsx;
 74         
 75         proc export
 76           data=sashelp.class
 77           file="&amp;amp;exfil"
 78           dbms=xlsx
 79           replace
 80         ;
 81         sheet='S1';
 82         
 
 NOTE: The export data set has 19 observations and 5 variables.
 NOTE: "/folders/myfolders/test.xlsx" file was successfully created.
 NOTE:  Verwendet wurde: PROZEDUR EXPORT - (Gesamtverarbeitungszeit):
       real time           0.06 seconds
       cpu time            0.04 seconds
       
 
 83         proc export
 84           data=sashelp.cars
 85           file="&amp;amp;exfil"
 86           dbms=xlsx
 87           replace
 88         ;
 89         sheet='S2';
 90         
 
 NOTE: The export data set has 428 observations and 15 variables.
 NOTE: "/folders/myfolders/test.xlsx" file was successfully created.
 NOTE:  Verwendet wurde: PROZEDUR EXPORT - (Gesamtverarbeitungszeit):
       real time           0.07 seconds
       cpu time            0.05 seconds
       
 
 91         proc export
 92           data=sashelp.shoes
 93           file="&amp;amp;exfil"
 94           dbms=xlsx
 95           replace
 96         ;
 97         sheet='S3';
 98         run;
 
 NOTE: The export data set has 395 observations and 7 variables.
 NOTE: "/folders/myfolders/test.xlsx" file was successfully created.
 NOTE:  Verwendet wurde: PROZEDUR EXPORT - (Gesamtverarbeitungszeit):
       real time           0.06 seconds
       cpu time            0.06 seconds
       
 
 99         
 100        libname www xlsx "&amp;amp;exfil";
 NOTE: Libref WWW was successfully assigned as follows: 
       Engine:        XLSX 
       Physical Name: /folders/myfolders/test.xlsx
 101        
 102        proc contents data=www._all_;
 103        run;
 
 NOTE:  Verwendet wurde: PROZEDUR CONTENTS - (Gesamtverarbeitungszeit):
       real time           0.26 seconds
       cpu time            0.25 seconds
       
 
 104        
 105        data RRR_Sheet1;
 106          set www.S1;
 107        run;
 
 NOTE: The import data set has 19 observations and 5 variables.
 NOTE: There were 19 observations read from the data set WWW.S1.
 NOTE: The data set WORK.RRR_SHEET1 has 19 observations and 5 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.02 seconds
       cpu time            0.02 seconds
&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 12:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607649#M176696</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-27T12:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: excel engine to import excel  into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607650#M176697</link>
      <description>&lt;P&gt;name is S1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 12:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/excel-engine-to-import-excel-into-SAS/m-p/607650#M176697</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-11-27T12:16:32Z</dc:date>
    </item>
  </channel>
</rss>

