<?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 multiple excel files from the PC Files Server in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72946#M7239</link>
    <description>Hi Ketan,&lt;BR /&gt;
&lt;BR /&gt;
asking the obvious, you did change the path in [pre] rc=filename("mydir","C:\PathToMyFiles"); [/pre], did you? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Afaik the PC Files SERVER isn't a classic server like a workspace server, therefore there is no way to display it in the EG server list. What would you want to achieve by doing this?&lt;BR /&gt;
&lt;BR /&gt;
br, Thomas</description>
    <pubDate>Thu, 09 Jun 2011 07:00:01 GMT</pubDate>
    <dc:creator>tbatliner</dc:creator>
    <dc:date>2011-06-09T07:00:01Z</dc:date>
    <item>
      <title>Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72943#M7236</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to import multiple Excel files that are in a folder on the PC Files Server into EG 4.3.&lt;BR /&gt;
&lt;BR /&gt;
I have used the libname and data step before to import just one file; however I am not sure how to tweak this to make it work for multiple files especially since the file names and # of files could be different every time.&lt;BR /&gt;
&lt;BR /&gt;
I have also used the infile statement with the *.* option in a data step before to import multiple files, but the files were already on the SAS server.&lt;BR /&gt;
&lt;BR /&gt;
Anybody know of a way to do this?&lt;BR /&gt;
&lt;BR /&gt;
kdp</description>
      <pubDate>Mon, 06 Jun 2011 17:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72943#M7236</guid>
      <dc:creator>kdp</dc:creator>
      <dc:date>2011-06-06T17:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72944#M7237</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
we are doing this with macros, similar to the code below:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%macro import;&lt;BR /&gt;
&lt;BR /&gt;
data files(keep=Filename);&lt;BR /&gt;
  rc=filename("mydir","C:\PathToMyFiles");&lt;BR /&gt;
  did=dopen("mydir");&lt;BR /&gt;
  if did GT 0 then do;&lt;BR /&gt;
    memcount=dnum(did);&lt;BR /&gt;
    if memcount gt 0 then do i=1 to memcount;&lt;BR /&gt;
      Filename=dread(did,i);&lt;BR /&gt;
      /* subsetting the list */&lt;BR /&gt;
      if substr(upcase(Filename),1,3)='BLA' and INDEX(upcase(Filename) ,'.XLS') then output;&lt;BR /&gt;
    end;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data files;&lt;BR /&gt;
  set files;&lt;BR /&gt;
  call symput('numcopyf',_N_);&lt;BR /&gt;
run;&lt;BR /&gt;
%put Files to read: &amp;amp;numcopyf;&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;numcopyf gt 0 %then %do;&lt;BR /&gt;
  %do i=1 %to &amp;amp;numcopyf;&lt;BR /&gt;
    data _null_;&lt;BR /&gt;
      set files;&lt;BR /&gt;
      if _N_=&amp;amp;i then do;&lt;BR /&gt;
        fn=filename;&lt;BR /&gt;
        call symput('f',fn);&lt;BR /&gt;
      end;&lt;BR /&gt;
    run;&lt;BR /&gt;
    %readinexcelfile(&amp;amp;f);		  &lt;BR /&gt;
  %end;&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
%mend import;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
In the %readinexcelfile macro you'll have to put your code for importing the data.&lt;BR /&gt;
&lt;BR /&gt;
hth, Thomas</description>
      <pubDate>Wed, 08 Jun 2011 14:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72944#M7237</guid>
      <dc:creator>tbatliner</dc:creator>
      <dc:date>2011-06-08T14:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72945#M7238</link>
      <description>Hi Thomas,&lt;BR /&gt;
&lt;BR /&gt;
I tried your code and it didn't seem to work. The first data step results in 0 observations even though there are files in the directory.&lt;BR /&gt;
&lt;BR /&gt;
I should mention that I am running EG 4.3 on the server, so maybe that's why it can't recognize the path.&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to map the PC Files Server as a server in the Server List in EG?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the code though, I will use it in some other application.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Ketan</description>
      <pubDate>Wed, 08 Jun 2011 16:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72945#M7238</guid>
      <dc:creator>kdp</dc:creator>
      <dc:date>2011-06-08T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72946#M7239</link>
      <description>Hi Ketan,&lt;BR /&gt;
&lt;BR /&gt;
asking the obvious, you did change the path in [pre] rc=filename("mydir","C:\PathToMyFiles"); [/pre], did you? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Afaik the PC Files SERVER isn't a classic server like a workspace server, therefore there is no way to display it in the EG server list. What would you want to achieve by doing this?&lt;BR /&gt;
&lt;BR /&gt;
br, Thomas</description>
      <pubDate>Thu, 09 Jun 2011 07:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72946#M7239</guid>
      <dc:creator>tbatliner</dc:creator>
      <dc:date>2011-06-09T07:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72947#M7240</link>
      <description>Hi Thomas,&lt;BR /&gt;
&lt;BR /&gt;
Yup, I did change the path name. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
In regards to mapping it in the EG server list...I was just thinking about other ways I could read the data in...just shooting in the dark at this point.&lt;BR /&gt;
&lt;BR /&gt;
Do you run this code on PC SAS or server based SAS?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Ketan</description>
      <pubDate>Thu, 09 Jun 2011 15:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72947#M7240</guid>
      <dc:creator>kdp</dc:creator>
      <dc:date>2011-06-09T15:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72948#M7241</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
we are using server based SAS with Win 64. Are you using IWA and the folder is on a different server than the workspace server? Because I just found out that that can result in problems. Does [pre] libname test "C:\PathToMyFiles"; [/pre] work for you in EG?&lt;BR /&gt;
&lt;BR /&gt;
br Tom</description>
      <pubDate>Thu, 09 Jun 2011 15:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72948#M7241</guid>
      <dc:creator>tbatliner</dc:creator>
      <dc:date>2011-06-09T15:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72949#M7242</link>
      <description>Not sure what IWA means, but the PC File Server is on a different server than all of our SAS servers.&lt;BR /&gt;
&lt;BR /&gt;
I tried the libname you suggested (yes, I did change the path), but the log states that the library does not exist.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
kdp</description>
      <pubDate>Thu, 09 Jun 2011 16:09:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72949#M7242</guid>
      <dc:creator>kdp</dc:creator>
      <dc:date>2011-06-09T16:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72950#M7243</link>
      <description>IWA stands for Integrated Windows Authentication, meaning that you're using eg. smartcard's for authentification...&lt;BR /&gt;
&lt;BR /&gt;
Well if EG can't find/read the folder you're trying to read files from than I guess you're having some sort of security restrictions in place. You'll need to resolve that first, PCFILES will only come afterwards...&lt;BR /&gt;
&lt;BR /&gt;
br Thomas</description>
      <pubDate>Thu, 09 Jun 2011 16:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72950#M7243</guid>
      <dc:creator>tbatliner</dc:creator>
      <dc:date>2011-06-09T16:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple excel files from the PC Files Server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72951#M7244</link>
      <description>You are right! I'll try to engage SAS Support.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for all your help!!&lt;BR /&gt;
&lt;BR /&gt;
Ketan</description>
      <pubDate>Thu, 09 Jun 2011 16:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-multiple-excel-files-from-the-PC-Files-Server/m-p/72951#M7244</guid>
      <dc:creator>kdp</dc:creator>
      <dc:date>2011-06-09T16:41:14Z</dc:date>
    </item>
  </channel>
</rss>

