<?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: Resetting Last Modified Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/813260#M320925</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3264"&gt;@Jeff_DOC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am not. The reason I need it changed is we are importing the file to Power BI and the import process requires a two digit modified time. If the file runs prior to 10 AM the time digits are only one digit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess I might have to figure out a different way to accomplish this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think perhaps you have a different problem here.&amp;nbsp; Whether the time is before 10AM should make NO difference at all.&amp;nbsp; I think perhaps you are trying to use a sledge hammer to swat a fly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS if you want to print a time value with leading zeros on the hour use the TOD format instead of the TIME format.&lt;/P&gt;
&lt;PRE&gt;376  data _null_;
377    do time='08:00't,'10:00't;
378      put time comma7. +1 time tod8. +1 time time8.;
379    end;
380  run;

 28,800 08:00:00  8:00:00
 36,000 10:00:00 10:00:00
&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 May 2022 16:34:21 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-05-13T16:34:21Z</dc:date>
    <item>
      <title>Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812714#M320671</link>
      <description>&lt;P&gt;Good morning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to ask a general question about output file last modified date. I don't have example code so I was looking for a hint or just a general direction to search to see if it's possible for SAS to set the output file last modified date to a different defined date? For instance, if I have an ODS EXCEL or PROC EXPORT process at 9:30 AM on May 5, that will become the output file last modified date. Can I force that last modified date to be a different date and time? Is there such a feature in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any direction someone could point me.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 16:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812714#M320671</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2022-05-11T16:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812728#M320678</link>
      <description>&lt;P&gt;In Windows, Powershell can change the last modified date. So you need to use SAS to issue a Powershell command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2011/09/15/calling-windows-powershell-from-sas-a-simple-example/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2011/09/15/calling-windows-powershell-from-sas-a-simple-example/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;eleven years ago)&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 17:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812728#M320678</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-11T17:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812770#M320698</link>
      <description>&lt;P&gt;My fault, I should have given more information, sorry.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to stay away from Power Shell in that there are times "recoders/code fixers" are not all that experienced. I'd like to stay away from methods that would allow a novice the ability to "discover" ways to user such powerful commands. It's also important that the method be as simple as possible so those same novice users can adjust it if anything breaks in the future. I was so hoping there was just a simple way to reset one of the file properties on file generation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 18:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812770#M320698</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2022-05-11T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812781#M320703</link>
      <description>&lt;P&gt;Forgetting SAS, if you had to do this outside of SAS, as far as I know there are two methods: manually, and via Powershell. Are you aware of any other method of changing this date?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 19:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812781#M320703</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-11T19:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812799#M320710</link>
      <description>&lt;P&gt;I am not. The reason I need it changed is we are importing the file to Power BI and the import process requires a two digit modified time. If the file runs prior to 10 AM the time digits are only one digit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess I might have to figure out a different way to accomplish this.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 20:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812799#M320710</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2022-05-11T20:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812824#M320722</link>
      <description>&lt;P&gt;I'm guessing you want the last modified date to match the timestamp of the data source? I understand the ask, but I don't think there is a SAS function for it. &lt;A href="http://You%20can find more doc in the ODS section of SAS documentation." target="_self"&gt;FINFO can get this info for you&lt;/A&gt;, but that just calls into the standard OS functions for retrieving file info.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;is correct: you need special tools to touch the file and reset the date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other ways to call external code include PROC FCMP (supports Python in SAS 9.4 Maint 6 and 7), PROC GROOVY, PROC LUA. But not sure if any of those would open the door for you. (And in SAS Viya, we have PROC PYTHON.)&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 23:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812824#M320722</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-05-11T23:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812872#M320747</link>
      <description>&lt;P&gt;You could wrap the powershell portion into a function using Proc FCMP and compile the function to somewhere it's available to users.&lt;/P&gt;
&lt;P&gt;Below some PoC that works in my environment. Needs option XCMD.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fcmp outlib=work.funcs.trial;
   function change_file_mod_dt(path_file $);
      cmd='powershell -command "(Get-Item ''C:\test\test.txt'').LastWriteTime=(''12 December 2016 14:00:00'')"';
      rc=system(cmd);
      return(rc);
   endsub;
options cmplib=work.funcs;

data _null_;
  rc=change_file_mod_dt('C:\test\test.txt');
  put rc=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 08:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812872#M320747</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-12T08:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812876#M320749</link>
      <description>&lt;P&gt;Doesn't Windows provide a simple command like the UNIX &lt;FONT face="courier new,courier"&gt;touch&lt;/FONT&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 08:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812876#M320749</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-12T08:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812879#M320750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Doesn't Windows provide a simple command like the UNIX &lt;FONT face="courier new,courier"&gt;touch&lt;/FONT&gt;?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I just Googled how to change the modification date in Windows using Powershell and nothing as simple as touch came up.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 08:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/812879#M320750</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-12T08:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/813250#M320918</link>
      <description>&lt;P&gt;Thank you very much to everyone who took the time to reply. The solution appears to be more complicated than I anticipated. I think they are all great solutions but unfortunately I can only mark one as a solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, thank you all.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 16:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/813250#M320918</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2022-05-13T16:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting Last Modified Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/813260#M320925</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3264"&gt;@Jeff_DOC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am not. The reason I need it changed is we are importing the file to Power BI and the import process requires a two digit modified time. If the file runs prior to 10 AM the time digits are only one digit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess I might have to figure out a different way to accomplish this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think perhaps you have a different problem here.&amp;nbsp; Whether the time is before 10AM should make NO difference at all.&amp;nbsp; I think perhaps you are trying to use a sledge hammer to swat a fly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS if you want to print a time value with leading zeros on the hour use the TOD format instead of the TIME format.&lt;/P&gt;
&lt;PRE&gt;376  data _null_;
377    do time='08:00't,'10:00't;
378      put time comma7. +1 time tod8. +1 time time8.;
379    end;
380  run;

 28,800 08:00:00  8:00:00
 36,000 10:00:00 10:00:00
&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 May 2022 16:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resetting-Last-Modified-Date/m-p/813260#M320925</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-13T16:34:21Z</dc:date>
    </item>
  </channel>
</rss>

