<?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: Directory Scans in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/173#M1475</link>
    <description>Vince@SAS: If you don't give people a forum to discuss the pertinent issue above, you will get people posting off topic. &lt;BR /&gt;
&lt;BR /&gt;
So put a forum topic in place to capture these demands, and you will get pure topic postings.</description>
    <pubDate>Mon, 22 May 2006 23:55:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2006-05-22T23:55:27Z</dc:date>
    <item>
      <title>Directory Scans</title>
      <link>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/170#M1472</link>
      <description>Is there a way SAS can scan a directory for a filename? &lt;BR /&gt;
&lt;BR /&gt;
I'm trying to automate a monthly reporting process. One of the files I need to use is only updated quarterly. They are kind enough to put the year and month in the file name (0512) and leave the rest of the file name identical. What I would like to do is scan the directory for the files aa0509bb.dbf aa0512bb.dbf and automatically determine which is the most recent and use that in my proc sql to link to other datasets. &lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Fri, 17 Mar 2006 14:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/170#M1472</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-17T14:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Directory Scans</title>
      <link>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/171#M1473</link>
      <description>Bob-&lt;BR /&gt;
&lt;BR /&gt;
This forum is intended for the discussion of issues pertaining to SAS Stored Processes:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/index.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/index.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
I believe the External File class of the SAS/AF product, or other functions of SAS/AF, provide a fairly straightforward way of getting a list of files in a directory.&lt;BR /&gt;
&lt;BR /&gt;
In the DATA Step, most people use a pipe+host directory command to get a list of files.&lt;BR /&gt;
&lt;BR /&gt;
Either way, once you get a list of files, you can put them into a SAS table and sort them, and/or use regular expressions or other character functions to manipulate the file names as you see fit.&lt;BR /&gt;
&lt;BR /&gt;
I hope that this helps you along the way.&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Fri, 17 Mar 2006 18:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/171#M1473</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2006-03-17T18:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Directory Scans</title>
      <link>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/172#M1474</link>
      <description>Hi Bob,&lt;BR /&gt;
There are some useful file functions which you can use within a datastep. The following example reads only XLS files from a certain place. Cheers Peter&lt;BR /&gt;
&lt;BR /&gt;
DATA save.input_files (KEEP = filename filepath id);&lt;BR /&gt;
   LENGTH filename filepath $256;&lt;BR /&gt;
   rc=FILENAME("readdir","&amp;amp;filepath");&lt;BR /&gt;
   did=DOPEN("readdir");&lt;BR /&gt;
   memcount=DNUM(did);&lt;BR /&gt;
   DO i = 1 TO memcount;&lt;BR /&gt;
      filename = DREAD(did,i);&lt;BR /&gt;
	  IF UPCASE(scan(filename,-1,".")) = "XLS" THEN&lt;BR /&gt;
		DO;&lt;BR /&gt;
	  	filepath = "&amp;amp;filepath\" !! TRIM(LEFT(filename));&lt;BR /&gt;
	  	id = i;&lt;BR /&gt;
	  	output;&lt;BR /&gt;
		END;&lt;BR /&gt;
   END;&lt;BR /&gt;
   rc=DCLOSE(did);&lt;BR /&gt;
RUN;</description>
      <pubDate>Tue, 21 Mar 2006 07:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/172#M1474</guid>
      <dc:creator>peter</dc:creator>
      <dc:date>2006-03-21T07:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Directory Scans</title>
      <link>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/173#M1475</link>
      <description>Vince@SAS: If you don't give people a forum to discuss the pertinent issue above, you will get people posting off topic. &lt;BR /&gt;
&lt;BR /&gt;
So put a forum topic in place to capture these demands, and you will get pure topic postings.</description>
      <pubDate>Mon, 22 May 2006 23:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Directory-Scans/m-p/173#M1475</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-05-22T23:55:27Z</dc:date>
    </item>
  </channel>
</rss>

