<?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: Requesting ideas to efficiently read multiple external files? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610189#M177684</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file_name;
rc=filename('fid','c:\temp\');
did=dopen('fid');
do i=1 to dnum(did);
 fname='c:\temp\'||dread(did,i);	output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 07 Dec 2019 11:33:06 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-12-07T11:33:06Z</dc:date>
    <item>
      <title>Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610069#M177630</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp; my objective is read a set of files(delimited) from a folder. The physical filename of the files have varying patterns and the need for me is to read certain files that follows the suit with the same pattern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, I am trying find ways of taking advantage of FILENAME statement pointing an aggregate location and read files in one shot of course with FILEVAR=. The plan seems ok but I first want to&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;take a look at the list of filenames&lt;/STRONG&gt; in the directory in programmed style unlike opening the folders manually to check.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. is there an easy straight forward way to &lt;EM&gt;&lt;STRONG&gt;list all the files in the directory&lt;/STRONG&gt;&lt;/EM&gt;?&lt;/P&gt;
&lt;P&gt;2. Once I can get 1 to work, I would read that using INPUT, write some REGEX to match the pattern and call that using FILEVAR= and be over with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively is there any better or efficient way to do the same that you could recommend? Please point me to the documentation if any. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 18:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610069#M177630</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-06T18:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610071#M177631</link>
      <description>&lt;P&gt;1.&amp;nbsp;&lt;A href="http://support.sas.com/kb/45/805.html" target="_blank"&gt;http://support.sas.com/kb/45/805.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0js70lrkxo6uvn1fl4a5aafnlgt.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0js70lrkxo6uvn1fl4a5aafnlgt.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Limit your list as you read it in to match the pattern and then pass that to the FILEVAR option.&lt;/P&gt;
&lt;P&gt;You can do this in one or data steps really. I'd do it in two because it's easier to debug and manage that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a wildcard is also an option, I think you know this already though&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 18:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610071#M177631</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-06T18:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610082#M177632</link>
      <description>1. yes, depending on your O/S...which is...?</description>
      <pubDate>Fri, 06 Dec 2019 19:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610082#M177632</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2019-12-06T19:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610085#M177634</link>
      <description>&lt;P&gt;"&lt;STRONG&gt;&lt;FONT color="#339966"&gt;2. Limit your list&lt;U&gt; as you read&lt;/U&gt; it in to match the pattern and then pass that to the FILEVAR option." -- Slick presence of mind!&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I knew of the wild card, but honestly didn't cross my mind. Thank you!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;1.&amp;nbsp;&lt;A href="http://support.sas.com/kb/45/805.html" target="_blank" rel="noopener"&gt;http://support.sas.com/kb/45/805.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0js70lrkxo6uvn1fl4a5aafnlgt.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0js70lrkxo6uvn1fl4a5aafnlgt.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;2. Limit your list as you read it in to match the pattern and then pass that to the FILEVAR option.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You can do this in one or data steps really. I'd do it in two because it's easier to debug and manage that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a wildcard is also an option, I think you know this already though&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627&lt;/A&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 19:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610085#M177634</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-06T19:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610136#M177672</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; &amp;nbsp;Sorry but a silly question because of my inexperience.&amp;nbsp; When I open a lot of text files, the header with col names looks like is split inton two lines, but firstobs=2 reads them correctly. Does that mean the values are wrapped?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 21:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610136#M177672</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-06T21:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610182#M177681</link>
      <description>Yup. Use a text editor like notepad++ to open text files. Then you can set options such as show invisible characters, such as line feeds and tabs. Makes it easier to debug things. &lt;BR /&gt;&lt;BR /&gt;You can also do this in Notepad by adjusting the word wrap option.</description>
      <pubDate>Sat, 07 Dec 2019 07:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610182#M177681</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-07T07:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting ideas to efficiently read multiple external files?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610189#M177684</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file_name;
rc=filename('fid','c:\temp\');
did=dopen('fid');
do i=1 to dnum(did);
 fname='c:\temp\'||dread(did,i);	output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Dec 2019 11:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Requesting-ideas-to-efficiently-read-multiple-external-files/m-p/610189#M177684</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-07T11:33:06Z</dc:date>
    </item>
  </channel>
</rss>

