<?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 reading files in a directory - help with space in directory name... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63740#M13859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Yes, in your original program, move the first double-quote immediately before the file path; you have it in front of the dir command.&amp;nbsp; In other words, change it to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata pipe 'dir "C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\*.txt" /b' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I suggest you use the TRUNCOVER option on your INFILE statement, and define your FIL2READ variable to a specific length (like $200).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Sep 2011 22:03:57 GMT</pubDate>
    <dc:creator>BobD</dc:creator>
    <dc:date>2011-09-12T22:03:57Z</dc:date>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63731#M13850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is the code i am using to read a couple of text files but i keep getting a message telling me that "the system cannot find the path specified". from what i have gathered, i think my problem has to do with the spaces in the directory location.&amp;nbsp; could anyone point me in direction to resolve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata pipe '"dir C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\*.txt" /b' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Floor_sp ;&lt;/P&gt;&lt;P&gt; infile indata ;&lt;/P&gt;&lt;P&gt; input f2r :$200. ;&lt;/P&gt;&lt;P&gt; fil2read = 'C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\' || f2r ;&lt;/P&gt;&lt;P&gt; infile dummy filevar = fil2read end = done firstobs = 2 ;&lt;/P&gt;&lt;P&gt; do while (not done) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @5&amp;nbsp; CZ&amp;nbsp; 2.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @10 BTYPE&amp;nbsp; $14. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @27 YEAR&amp;nbsp; 4. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @35 HISTF&amp;nbsp; 8.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @47 BCASTF&amp;nbsp; 8.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @59 ADDITIONS&amp;nbsp; 8.4&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output ;&lt;/P&gt;&lt;P&gt; end ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 19:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63731#M13850</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-09-12T19:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63732#M13851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is space in output from PIPE the input statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input f2r :$200. ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;will only read to the first blank.&amp;nbsp; The colon is for LIST input.&amp;nbsp; Remove the colon and add TRUNCOVER to the INFILE INDATA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 20:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63732#M13851</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-09-12T20:24:12Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63733#M13852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The pipe is not necessary for what you are trying to accomplish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata 'C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\*.txt';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Floor_sp;&lt;/P&gt;&lt;P&gt;infile indata filevar = fil2read end = done firstobs = 2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @5&amp;nbsp; CZ&amp;nbsp; 2. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @10 BTYPE&amp;nbsp; $14.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @27 YEAR&amp;nbsp; 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @35 HISTF&amp;nbsp; 8.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @47 BCASTF&amp;nbsp; 8.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @59 ADDITIONS&amp;nbsp; 8.4&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 20:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63733#M13852</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-12T20:30:00Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63734#M13853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;okay this is what i tried but i keep getting the same message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stderr output:&lt;/P&gt;&lt;P&gt;The system cannot find the path specified.&lt;/P&gt;&lt;P&gt;NOTE: 0 records were read from the infile INDATA.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.FLOOR_SP has 0 observations and 8 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Floor_sp ;&lt;/P&gt;&lt;P&gt; infile indata ;&lt;/P&gt;&lt;P&gt; input f2r $200. TRUNCOVER ;&lt;/P&gt;&lt;P&gt; fil2read = 'C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\' || f2r ;&lt;/P&gt;&lt;P&gt; infile dummy filevar = fil2read end = done firstobs = 2 ;&lt;/P&gt;&lt;P&gt; do while (not done) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @5&amp;nbsp; CZ&amp;nbsp; 2.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @10 BTYPE&amp;nbsp; $14. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @27 YEAR&amp;nbsp; 4. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @35 HISTF&amp;nbsp; 8.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @47 BCASTF&amp;nbsp; 8.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @59 ADDITIONS&amp;nbsp; 8.4&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output ;&lt;/P&gt;&lt;P&gt; end ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 20:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63734#M13853</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-09-12T20:39:00Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63735#M13854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i used the program you listed and saw quite a few errors..i am posting them below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Invalid physical name.&lt;/P&gt;&lt;P&gt;fil2read=&amp;nbsp; done=0 CZ=. BTYPE=&amp;nbsp; YEAR=. HISTF=. BCASTF=. ADDITIONS=. _ERROR_=1 _N_=1&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.FLOOR_SP may be incomplete.&amp;nbsp; When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; observations and 6 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.FLOOR_SP was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 20:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63735#M13854</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-09-12T20:46:43Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63736#M13855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to resolve the problem with the values of the variable FIL2READ.&amp;nbsp; Use PUTLOG to inspect the value.&amp;nbsp; Copy the value from the log and see if you can use it to open the file. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63736#M13855</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-09-12T21:25:12Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63737#M13856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Back to your original code, I have a suggestion, a comment and a question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The suggestion: try it with double quotes at the start and end, and double double quotes around the file name.&amp;nbsp; i.e. &lt;/P&gt;&lt;P&gt;filename indata pipe "dir ""C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\*.txt"" /b ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The comment: you are likely to run into problems with your next use of the directory as double quotes will likely be needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question: what are you trying to do?&amp;nbsp; At first I thought you were trying to get a file (via the piped dir), then getting a 2nd file name from that file, then trying to read the file.&amp;nbsp; Is that correct or do you just want to read the file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63737#M13856</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-12T21:26:11Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63738#M13857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have 3 text files that i am trying to read.&amp;nbsp; they are identical files (in terms of layout) but differe by one category. the first input should get me a list of files and then next input section "should" read in each file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63738#M13857</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-09-12T21:43:40Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63739#M13858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take the DIR command out the double quotes you have around the filename in your DOS command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata pipe 'dir "C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\*.txt" /b' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your string is very long maybe it is wrapping in the editor?&amp;nbsp; Try breaking it into pieces using macros variables.&amp;nbsp; Use dquotes around the command and double the quotes that you want to send to DOS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let root=C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data;&lt;/P&gt;&lt;P&gt;%let project=CED_2011\Preliminary\Floorspace;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata pipe "dir "&amp;amp;root\&amp;amp;project\*.txt"" /b" ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRUNCOVER is an option on the INFILE statement, not the INPUT statement.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Add the TRUNCOVER option to both of your INFILE statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63739#M13858</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-12T22:01:33Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63740#M13859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Yes, in your original program, move the first double-quote immediately before the file path; you have it in front of the dir command.&amp;nbsp; In other words, change it to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata pipe 'dir "C:\Documents and Settings\agautam\Desktop\Selfgen\Model\Commercial\Commercial_Model_Input_Output_Data\CED_2011\Preliminary\Floorspace\*.txt" /b' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I suggest you use the TRUNCOVER option on your INFILE statement, and define your FIL2READ variable to a specific length (like $200).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63740#M13859</guid>
      <dc:creator>BobD</dc:creator>
      <dc:date>2011-09-12T22:03:57Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63741#M13860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I actually like fried eggs' suggestion, but double quote the directory and leave off the filevar option.&amp;nbsp; e.g.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata "C:\art\test folder\*.txt";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Floor_sp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile indata end = done firstobs = 2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63741#M13860</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-12T22:05:34Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63742#M13861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that would work, except that the FIRSTOBS option would only skip the first line of the first file.&amp;nbsp; I'm assuming the OP wants to skip the header record on each file, hence using the FILEVAR makes sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63742#M13861</guid>
      <dc:creator>BobD</dc:creator>
      <dc:date>2011-09-12T22:17:14Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63743#M13862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you so much!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63743#M13862</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-09-12T22:17:37Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63744#M13863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to hear that you solved your problem, but I still think that my (extremely slight) modification of FriedEgg's code would be your easiest and least troublesome way of solving that particular problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, while you apparently didn't confront the additional problem, I did, and for those who read this thread and can't figure out why a piped dir isn't working for them, they should take a look at: &lt;A href="http://support.sas.com/kb/41/863.html"&gt;http://support.sas.com/kb/41/863.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a problem with reading pipes on 64-bit window's machines.&amp;nbsp; One that can be circumvented, but a problem nonetheless.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63744#M13863</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-12T22:40:02Z</dc:date>
    </item>
    <item>
      <title>reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63745#M13864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/* create some dummy files */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; do i=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('filename file' || strip(i) || ' "/home/friedegg/file' || strip(i) || '.txt";');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('data _null_;');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' file file' || strip(i) || ';');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' put "a b c d e";');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' put "f g h i j";');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('run;');&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata '/home/mkastin/file*.txt';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; length _file _filex $512;&lt;/P&gt;&lt;P&gt; infile indata end=done filename=_file;&lt;/P&gt;&lt;P&gt; input (blah1-blah5) (:$1.);&lt;/P&gt;&lt;P&gt; retain _filex;&lt;/P&gt;&lt;P&gt; if _filex ne _file then&lt;/P&gt;&lt;P&gt;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _filex=_file;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; delete;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt; drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* remove this junk */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; do i=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('x "rm -f /home/friedegg/file' || strip(i) || '.txt";');&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63745#M13864</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-12T22:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63746#M13865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look up EOV INFILE statement option it is designed to detect the start of a new file in a concatenation.&amp;nbsp; Much easier than comparing file names. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2011 02:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63746#M13865</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-09-13T02:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: reading files in a directory - help with space in directory name...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63747#M13866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks _null_, I had forgotten about that option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* create some dummy files */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;do i=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('filename file' || strip(i) || ' "/home/friedegg/file' || strip(i) || '.txt";');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('data _null_;');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' file file' || strip(i) || ';');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' put "a b c d e";');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' put "f g h i j";');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('run;');&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename indata '/home/mkastin/file*.txt';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;length _file _filex $512;&lt;/P&gt;&lt;P&gt;infile indata eov=_firstrec_;&lt;/P&gt;&lt;P&gt;input (blah1-blah5) (:$1.);&lt;/P&gt;&lt;P&gt;if _n_ or _firstrec_ then delete; /* _firstrec_ will =1 for all files first record except the first */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* remove this junk */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;do i=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute('x "rm -f /home/friedegg/file' || strip(i) || '.txt";');&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2011 03:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-files-in-a-directory-help-with-space-in-directory-name/m-p/63747#M13866</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-13T03:01:03Z</dc:date>
    </item>
  </channel>
</rss>

