<?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: how to get the last modified file in a folder in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698421#M37524</link>
    <description>&lt;P&gt;Add a grep:&lt;/P&gt;
&lt;PRE&gt;ls &amp;amp;path -rt|grep validation&lt;/PRE&gt;
&lt;P&gt;this will filter for filenames that contain the string, while keeping the order.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 16:01:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-12T16:01:48Z</dc:date>
    <item>
      <title>how to get the last modified file in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698417#M37523</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am already using the macro below to get the latest modified file. As I am not very familiar with the Unix command, is there a way to improve this search tool to get the latest modified file in a folder for a file containing for example the word validation or the word scenario ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro lastmodifiedfile(path,MName);&lt;BR /&gt;&lt;BR /&gt;/** Change the filename below to the following to run on UNIX **/&lt;BR /&gt;/** filename test pipe "ls &amp;amp;path -rt"; **/&lt;/P&gt;
&lt;P&gt;/** Change the filename below to the following to run on Windows **/&lt;BR /&gt;/** filename test pipe "dir &amp;amp;path /od /t:w /b"; **/&lt;/P&gt;
&lt;P&gt;filename test pipe "ls &amp;amp;path -rt"; &lt;BR /&gt;&lt;BR /&gt;data _null_; &lt;BR /&gt;infile test; &lt;BR /&gt;input; &lt;BR /&gt;call symputx("&amp;amp;Mname.",_infile_,'g'); &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;%put Last file to be modified in &amp;amp;path is: &amp;amp;Mname.; &lt;BR /&gt;&lt;BR /&gt;%mend lastmodifiedfile;&lt;BR /&gt;%lastmodifiedfile(/dwh_operation/sasdata/smp_production/prod_smpi2/pilot/,Fname);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I would like to modified the above mentioned code to permit to add a part of the filename.&lt;/P&gt;
&lt;P&gt;ex:&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_validation_v1.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_validation_v2.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_validation_v3.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_validation_v3.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_scenario_v1.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_scenario_v2.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//.../pilote_2020_scenario_v3.spde...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moreover, I can't use the version number to trace the latest modified file.&amp;nbsp; So is there a way to modified the script to specify file containing the word validation, then the word scenario and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank in advance for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 15:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698417#M37523</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2020-11-12T15:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the last modified file in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698421#M37524</link>
      <description>&lt;P&gt;Add a grep:&lt;/P&gt;
&lt;PRE&gt;ls &amp;amp;path -rt|grep validation&lt;/PRE&gt;
&lt;P&gt;this will filter for filenames that contain the string, while keeping the order.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 16:01:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698421#M37524</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T16:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the last modified file in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698434#M37526</link>
      <description>Thank you so much for your help</description>
      <pubDate>Thu, 12 Nov 2020 16:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-last-modified-file-in-a-folder/m-p/698434#M37526</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2020-11-12T16:22:04Z</dc:date>
    </item>
  </channel>
</rss>

