<?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: External Files move with datetime in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570539#M34100</link>
    <description>&lt;P&gt;Run your move code with filename pipe:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let tdate=%sysfunc(datetime(),e8601dt19.);

filename oscmd pipe "move 'D:\PM\Myexcel.xlsx' 'D:\Myexcel&amp;amp;tdate..xlsx' 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and look at the log, If puzzled, post the log here, using the {i} button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the single quotes are masked by the outer double quotes, the macro variable will be resolved.&lt;/P&gt;
&lt;P&gt;And I used a ISO format for the timestamp, which makes much more sense than the standard SAS datetime format.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2019 13:04:21 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-07-02T13:04:21Z</dc:date>
    <item>
      <title>External Files move with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570458#M34097</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I want to move external(xlsx) file one location to another location with suffix Datetime.&lt;/P&gt;&lt;P&gt;My file name is Myexcel.xlsx&lt;/P&gt;&lt;P&gt;&amp;nbsp;I use this code:&lt;/P&gt;&lt;P&gt;%let tdate=%sysfunc(datetime(),datetime.);&lt;/P&gt;&lt;P&gt;x %unquote(%str(%')move "D:\PM\Myexcel.xlsx" "D:\Myexcel&amp;amp;tdate..xlsx"%str(%'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this code is not work. When I remove macro refrence then code is work.But I want when I am moving this file then name should be "Myexcel02Jul2019 02:32 PM.xlsx"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to move file with suffix datetime ?Can you explain it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Nirav&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:04:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570458#M34097</guid>
      <dc:creator>NiravC</dc:creator>
      <dc:date>2019-07-02T09:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: External Files move with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570488#M34098</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;Can you try something like this instead, to see if it works?&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let tdate=%sysfunc(datetime(),datetime.);
%let cmd = cp sasv9_usermods.cfg sasv9_usermods&amp;amp;tdate..cfg;

filename test pipe "&amp;amp;cmd";

data test;
 length result $200;
 infile test truncover delimiter='|';
 input result ;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jul 2019 11:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570488#M34098</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2019-07-02T11:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: External Files move with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570493#M34099</link>
      <description>hii Fredrike,&lt;BR /&gt;&lt;BR /&gt;Is this file move code?&lt;BR /&gt;I didn't get it anything this code.&lt;BR /&gt;can you explain it out?</description>
      <pubDate>Tue, 02 Jul 2019 11:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570493#M34099</guid>
      <dc:creator>NiravC</dc:creator>
      <dc:date>2019-07-02T11:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: External Files move with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570539#M34100</link>
      <description>&lt;P&gt;Run your move code with filename pipe:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let tdate=%sysfunc(datetime(),e8601dt19.);

filename oscmd pipe "move 'D:\PM\Myexcel.xlsx' 'D:\Myexcel&amp;amp;tdate..xlsx' 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and look at the log, If puzzled, post the log here, using the {i} button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the single quotes are masked by the outer double quotes, the macro variable will be resolved.&lt;/P&gt;
&lt;P&gt;And I used a ISO format for the timestamp, which makes much more sense than the standard SAS datetime format.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 13:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570539#M34100</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-02T13:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: External Files move with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570805#M34109</link>
      <description>&lt;P&gt;Hi KurtBremser,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Here is the log:


26         %let tdate=%sysfunc(datetime(),e8601dt19.);
27         
28         filename oscmd pipe "move 'D:\SAS_DATA_IMPORT\66-0217\PM\IPR_A.xlsx' 'D:\IPR_A&amp;amp;tdate..xlsx' 2&amp;gt;&amp;amp;1";
29         
30         data _null_;
31         infile oscmd;
32         input;
33         put _infile_;
34         run;

NOTE: The infile OSCMD is:
      Unnamed Pipe Access Device,
      PROCESS=move 'D:\SAS_DATA_IMPORT\66-0217\PM\IPR_A.xlsx' 'D:\IPR_A2019-07-03T09:21:29.xlsx' 2&amp;gt;&amp;amp;1,
      RECFM=V,LRECL=32767

The filename, directory name, or volume label syntax is incorrect.
NOTE: 1 record was read from the infile OSCMD.
      The minimum record length was 66.
      The maximum record length was 66.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds
      &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I used this code but file is not moving.Can you explain to me what should I do next?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nirav&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 04:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570805#M34109</guid>
      <dc:creator>NiravC</dc:creator>
      <dc:date>2019-07-03T04:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: External Files move with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570840#M34110</link>
      <description>&lt;P&gt;Windows obviously does not like colons in filenames (just tested that), so you should use the b8601dt15. format for creating the timestamp (no hyphens, no colons).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 06:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/External-Files-move-with-datetime/m-p/570840#M34110</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-03T06:31:31Z</dc:date>
    </item>
  </channel>
</rss>

