<?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 All Members in a Directory in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34458#M6779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quick question for a Friday afternoon to warm up your thinking devices...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a directory with over 9,000 members in it - they are all small (about 25 lines of text) - and the member name contains the date and time stamp for that data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I do a "X command" directory listing, and then read that list back in and process the data with a macro that loops through all the members.&amp;nbsp; The date and time is added to each of the members read and then the whole thing is rolled up into a single SAS table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if I change this to a "wild card" read using th INFILE statement, is there a way to still retain the date and time values from the member name?&amp;nbsp; I seem to remember that the name of the member may be in the meta data somewhere, but I can't find any references.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also - I'm thinking that reading the entire directory using the wild card approach will be much faster, but does anyone have proof?&amp;nbsp; (I expect that I will have said proof if there is a way for me to use the wild card input....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 17:55:31 GMT</pubDate>
    <dc:creator>OS2Rules</dc:creator>
    <dc:date>2012-03-16T17:55:31Z</dc:date>
    <item>
      <title>Reading All Members in a Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34458#M6779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quick question for a Friday afternoon to warm up your thinking devices...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a directory with over 9,000 members in it - they are all small (about 25 lines of text) - and the member name contains the date and time stamp for that data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I do a "X command" directory listing, and then read that list back in and process the data with a macro that loops through all the members.&amp;nbsp; The date and time is added to each of the members read and then the whole thing is rolled up into a single SAS table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if I change this to a "wild card" read using th INFILE statement, is there a way to still retain the date and time values from the member name?&amp;nbsp; I seem to remember that the name of the member may be in the meta data somewhere, but I can't find any references.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also - I'm thinking that reading the entire directory using the wild card approach will be much faster, but does anyone have proof?&amp;nbsp; (I expect that I will have said proof if there is a way for me to use the wild card input....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 17:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34458#M6779</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2012-03-16T17:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading All Members in a Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34459#M6780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you reading the data in all files into a single SAS data set?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reading from wild card you will need to understand FILENAME= INFILE statement option.&amp;nbsp; Also you should learn about INFILE statement output EOV=.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is should be faster than macro looping as you will need only ONE data step to read all files. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 18:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34459#M6780</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-16T18:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading All Members in a Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34460#M6781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example of datanull's suggestion.&amp;nbsp; Try it, compare it with your method, and let us know which works faster:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let path=c:\art\test\;&lt;/P&gt;&lt;P&gt;/*create some test data;*/&lt;/P&gt;&lt;P&gt;%macro makem;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do i=1 %to 1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file "&amp;amp;path.f&amp;amp;i..txt";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to 1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put j j;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend makem;&lt;/P&gt;&lt;P&gt;%makem&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length inname $80;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile "&amp;amp;path.f*.txt" filename=inname;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filenm=substr(inname,13);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 19:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34460#M6781</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-16T19:23:54Z</dc:date>
    </item>
    <item>
      <title>Reading All Members in a Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34461#M6782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just what I was looking for.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have &amp;gt; 16,000 members in the directory that I have to read.&amp;nbsp; It takes about 20 minutes to read using a macro loop to read each memner, and about 3 minutes using the wildcard method.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wild card method is obviously faster (and easier to code!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 19:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34461#M6782</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2012-03-19T19:18:17Z</dc:date>
    </item>
    <item>
      <title>Reading All Members in a Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34462#M6783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But wildcard is not as flexiable as the PIPE + filevar=&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 02:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-All-Members-in-a-Directory/m-p/34462#M6783</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-20T02:56:01Z</dc:date>
    </item>
  </channel>
</rss>

