<?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: import excel files when using filename indata pipe but the directory has spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411710#M100659</link>
    <description>&lt;P&gt;What do you mean? Could you please explain more?&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2017 21:37:38 GMT</pubDate>
    <dc:creator>daisy6</dc:creator>
    <dc:date>2017-11-08T21:37:38Z</dc:date>
    <item>
      <title>import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411703#M100656</link>
      <description>&lt;P&gt;Hi SAS experts,&lt;/P&gt;&lt;P&gt;I use filename pipe to read some excel files into SAS. The directories are macros and also have some spaces. The codes I usually uses do not work this time. As far as I know, if the directory has no space, my code works.&amp;nbsp; Here is my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dir=c:\projects\2017\NFL;&lt;/P&gt;&lt;P&gt;%let fold1= National Football League (NFL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename indata pipe "dir &amp;amp;dir.\&amp;amp;fold1. /d"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;data file_list;&lt;BR /&gt;length fname$ 256.;&lt;BR /&gt;infile indata truncover length=reclen; /* infile statement for file names */&lt;BR /&gt;input fname $256.; /* read the file names from the directory */&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the log window shows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stderr output:&lt;BR /&gt;File Not Found&lt;BR /&gt;File Not Found&lt;BR /&gt;NOTE: 17 records were read from the infile INDATA.&lt;BR /&gt;The minimum record length was 0.&lt;BR /&gt;The maximum record length was 38.&lt;BR /&gt;NOTE: The data set WORK.FILENAMES has 17 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.09 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The filenames dataset :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Volume in drive C is OSDisk&lt;/P&gt;&lt;P&gt;Volume Serial Number is ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Directory of C:\projects\2017\NFL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give me some hints to solve the problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411703#M100656</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-08T21:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411708#M100658</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you try using the folder name like &lt;STRONG&gt;'folder name with space'n&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411708#M100658</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2017-11-08T21:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411710#M100659</link>
      <description>&lt;P&gt;What do you mean? Could you please explain more?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411710#M100659</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-08T21:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411719#M100664</link>
      <description>&lt;P&gt;The 'directory' in this case does have spaces, look at your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let dir=c:\projects\2017\NFL;&lt;/P&gt;
&lt;P&gt;%let fold1= National Football League (NFL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename indata pipe "dir &amp;amp;dir.\&amp;amp;fold1. /d"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;which becomes, I've noted in red the spaces.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename indata pipe "dir &lt;SPAN&gt;c:\projects\2017\NFL&lt;/SPAN&gt;\&lt;SPAN&gt;National&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;&lt;/STRONG&gt;Football&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;_&lt;/STRONG&gt;&lt;/FONT&gt;League&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;_&lt;/STRONG&gt;&lt;/FONT&gt;(NFL)&lt;/SPAN&gt; /d"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So you need to quote it properly to allow those to resolve, try the following (sorry I hit enter earlier on this post):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename indata pipe "dir ""&amp;amp;dir.\&amp;amp;fold1."" /d" &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411719#M100664</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-08T21:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411720#M100665</link>
      <description>&lt;P&gt;You have to enclose the path in quotes in the dir-command, because it contains chars which should be avoided when creating directories. Not easy to test on my mac ... maybe something like&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename indata pipe "dir ""&amp;amp;dir.\&amp;amp;fold1."" /d" &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411720#M100665</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-11-08T21:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411725#M100670</link>
      <description>&lt;P&gt;Thanks for the reply! Reeza&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 22:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411725#M100670</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-08T22:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: import excel files when using filename indata pipe but the directory has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411727#M100671</link>
      <description>It works, Thanks for the reply!</description>
      <pubDate>Wed, 08 Nov 2017 22:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-files-when-using-filename-indata-pipe-but-the/m-p/411727#M100671</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-08T22:01:54Z</dc:date>
    </item>
  </channel>
</rss>

