<?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: Filename - based on date file was created in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442917#M110781</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can run x-commands to read all the files in a folder. Does your excel files have datestamp on files names? If yes and you don't have access to run x-commands then the following code can read the files in a specific folder.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME _folder_ "%bquote(C:\Program Files\test)";
data filenames(keep=memname);
  handle=dopen( '_folder_' );
  if handle &amp;gt; 0 then do;
    count=dnum(handle);
    do i=1 to count;
      memname=dread(handle,i);
      output filenames;
    end;
  end;
  rc=dclose(handle);
run;
filename _folder_ clear;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 15:06:56 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-03-06T15:06:56Z</dc:date>
    <item>
      <title>Filename - based on date file was created</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442647#M110707</link>
      <description>&lt;P&gt;I'm trying to automate a program that reads in EXCEL files.&amp;nbsp; Currently I have to browse to the Windows directory to see what files have been added, then I copy/paste into my program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to scan the Windows Folder and find the files with yesterdays date dynamically to create my filename statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Tammy&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442647#M110707</guid>
      <dc:creator>TMiles</dc:creator>
      <dc:date>2018-03-06T14:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filename - based on date file was created</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442898#M110773</link>
      <description>&lt;P&gt;Yes, there are multiple ways to do it.&lt;/P&gt;
&lt;P&gt;You could either use SAS external file functions to find out directory contents, files and their creation dates (FINFO).&lt;/P&gt;
&lt;P&gt;Or, have an OS script prepare that information for you, import it to SAS, and use macro coding to generate FILEAME based on that.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442898#M110773</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-03-06T14:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filename - based on date file was created</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442917#M110781</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can run x-commands to read all the files in a folder. Does your excel files have datestamp on files names? If yes and you don't have access to run x-commands then the following code can read the files in a specific folder.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME _folder_ "%bquote(C:\Program Files\test)";
data filenames(keep=memname);
  handle=dopen( '_folder_' );
  if handle &amp;gt; 0 then do;
    count=dnum(handle);
    do i=1 to count;
      memname=dread(handle,i);
      output filenames;
    end;
  end;
  rc=dclose(handle);
run;
filename _folder_ clear;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 15:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/442917#M110781</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-03-06T15:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filename - based on date file was created</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/443394#M110926</link>
      <description>&lt;P&gt;This works great -what is the command to find the file create date so I only get the files&amp;nbsp; I need each day?&amp;nbsp; Or if you can point me to documentation I would be most grateful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 16:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-based-on-date-file-was-created/m-p/443394#M110926</guid>
      <dc:creator>TMiles</dc:creator>
      <dc:date>2018-03-07T16:07:19Z</dc:date>
    </item>
  </channel>
</rss>

