<?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 Excel with 24 sheets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15456#M2710</link>
    <description>use sas libname engine for excel, like[pre]   libname ex 'your.work.book.xls' ;[/pre]Unfortunately, to copy all sheets into the work library:[pre]   proc copy in= ex out= work ;&lt;BR /&gt;
   run ; [/pre]didn't work for me. Not even with [pre]option validvarname= ANY ;[/pre]However, this copies sheet1[pre]data s1; set  ex."sheet1$"n ; run;[/pre]So, you could use a macro loop, or more simple CALL EXECUTE(), like[pre]   data _null_ ;&lt;BR /&gt;
      do ns= 1 to 24 /*yoursheet count*/ ;&lt;BR /&gt;
         ds = 'S' !! put( ns, 2.-L ); &lt;BR /&gt;
         sh = 'sheet' !! put( ns, 2.-L ); &lt;BR /&gt;
         call execute( 'data ' !! ds  ) ;&lt;BR /&gt;
         call execute( '; set ex."' !! trim(sh)!! '$"n ; run; ' ) ;&lt;BR /&gt;
      end;&lt;BR /&gt;
   run;[/pre]...... it works for me.&lt;BR /&gt;
Then you can work with the 24 data sets in the work library named S1 to S24.&lt;BR /&gt;
  &lt;BR /&gt;
good luck &lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
    <pubDate>Mon, 06 Apr 2009 10:24:30 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2009-04-06T10:24:30Z</dc:date>
    <item>
      <title>Importing Excel with 24 sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15455#M2709</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
i have a Excel in this i have 24 sheets sheet1 to sheet24 all this sheets have same variables how can i import all the sheets at once.</description>
      <pubDate>Mon, 06 Apr 2009 08:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15455#M2709</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-04-06T08:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel with 24 sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15456#M2710</link>
      <description>use sas libname engine for excel, like[pre]   libname ex 'your.work.book.xls' ;[/pre]Unfortunately, to copy all sheets into the work library:[pre]   proc copy in= ex out= work ;&lt;BR /&gt;
   run ; [/pre]didn't work for me. Not even with [pre]option validvarname= ANY ;[/pre]However, this copies sheet1[pre]data s1; set  ex."sheet1$"n ; run;[/pre]So, you could use a macro loop, or more simple CALL EXECUTE(), like[pre]   data _null_ ;&lt;BR /&gt;
      do ns= 1 to 24 /*yoursheet count*/ ;&lt;BR /&gt;
         ds = 'S' !! put( ns, 2.-L ); &lt;BR /&gt;
         sh = 'sheet' !! put( ns, 2.-L ); &lt;BR /&gt;
         call execute( 'data ' !! ds  ) ;&lt;BR /&gt;
         call execute( '; set ex."' !! trim(sh)!! '$"n ; run; ' ) ;&lt;BR /&gt;
      end;&lt;BR /&gt;
   run;[/pre]...... it works for me.&lt;BR /&gt;
Then you can work with the 24 data sets in the work library named S1 to S24.&lt;BR /&gt;
  &lt;BR /&gt;
good luck &lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Mon, 06 Apr 2009 10:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15456#M2710</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-04-06T10:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Excel with 24 sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15457#M2711</link>
      <description>a little addon is neccessary in case your  nine first sheet names are &lt;BR /&gt;
written as sheet01-sheet09 in place of sheet1-sheet-9 sheet10-sheet24&lt;BR /&gt;
&lt;BR /&gt;
Change this line in forwarded code &lt;BR /&gt;
  sh = 'sheet' !! put( ns, z2.-L ); &lt;BR /&gt;
&lt;BR /&gt;
Andre</description>
      <pubDate>Mon, 06 Apr 2009 11:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Excel-with-24-sheets/m-p/15457#M2711</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2009-04-06T11:06:43Z</dc:date>
    </item>
  </channel>
</rss>

