<?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 rename a file using unix command mv in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913705#M44230</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;I assume this question is related to your other question &lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-an-XML-file-name-to-a-valid-sas-filename-on-a/m-p/913671#M44226" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need to rename this XML file only for the purpose to read the data into SAS. The content of the XML file does not depend on the name of the file. It's the content that determines the table names you'll get when converting the data to SAS tables. It's no issue at all if the XML file name does not comply with SAS naming standards for SAS tables.&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2024 01:33:20 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2024-01-31T01:33:20Z</dc:date>
    <item>
      <title>How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913697#M44227</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a file hosted on unix server who name is Virage Survey.xml&lt;/P&gt;
&lt;P&gt;I would like to change the name for VirageSurvey.xml&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried this unix command directly on the terminal and it works&lt;/P&gt;
&lt;P&gt;mv "path1/Virage Survey.xml" "path1/VirageSurvey.xml"&lt;/P&gt;
&lt;P&gt;but in SAS EG I have tried this and nothing append.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x 'mv "path1/Virage Survey.xml" "path1/VirageSurvey.xml"';&lt;/P&gt;
&lt;P&gt;Any suggestion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 23:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913697#M44227</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-01-30T23:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913698#M44228</link>
      <description>&lt;P&gt;What does your LOG show when you attempt that X command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did your path start at the root of the drive? If not then the path likely would have been treated relative to where SAS is executing and would typically not find the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And don't forget that&amp;nbsp; UNIX file names and paths are case sensitive and upper case characters are a poor idea in general.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 00:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913698#M44228</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-01-31T00:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913700#M44229</link>
      <description>&lt;P&gt;It is probably simpler to remove PATH from the problem.&amp;nbsp; If you were doing this in a terminal window you would just do:&lt;/P&gt;
&lt;PRE&gt;cd "path1"
mv "Virage Survey.xml" "VirageSurvey.xml"&lt;/PRE&gt;
&lt;P&gt;The quotes are required around any value that contains an embedded space, like your first name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to generate that in SAS code I would call the QUOTE() function to make sure the quotes are generated properly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile %sysfunc(quote(cd "path1" ; mv "Virage Survey.xml" "VirageSurvey.xml")) pipe ;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you are moving the file from one directory to a different directory you need to make sure that both directories are on the same mounted disk volume.&amp;nbsp; &lt;STRONG&gt;The mv command cannot copy a file to another disk.&amp;nbsp;&lt;/STRONG&gt; It just changes the directory entries.&amp;nbsp; If you want to move to a different disk you will have copy first and then delete the original to get the effect of a "move".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 00:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913700#M44229</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-31T00:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913705#M44230</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;I assume this question is related to your other question &lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-an-XML-file-name-to-a-valid-sas-filename-on-a/m-p/913671#M44226" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need to rename this XML file only for the purpose to read the data into SAS. The content of the XML file does not depend on the name of the file. It's the content that determines the table names you'll get when converting the data to SAS tables. It's no issue at all if the XML file name does not comply with SAS naming standards for SAS tables.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 01:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913705#M44230</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-31T01:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913728#M44231</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;I have to correct you. &lt;FONT face="courier new,courier"&gt;mv&lt;/FONT&gt; can in fact move files across devices. Only when it realizes source and destination are on the same device will it do a rename alone.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 08:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913728#M44231</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-31T08:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913729#M44232</link>
      <description>&lt;P&gt;Don't use the X statement. Always use the PIPE method to see what happens:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe 'mv "path1/Virage Survey.xml" "path1/VirageSurvey.xml" 2&amp;gt;&amp;amp;1';

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will see all responses in the SAS log. If nothing appears, the command worked.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 08:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913729#M44232</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-31T08:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913791#M44235</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let file_path=/finsys/.../data;

filename oscmd pipe 'mv "&amp;amp;file_path./Virage Survey.xml" "file_path./VirageSurvey.xml" 2&amp;gt;&amp;amp;1';

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It seems that the &amp;amp;file_path. macro variable is not evaluated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The infile OSCMD is:&lt;BR /&gt;2 The SAS System 08:43 Wednesday, January 31, 2024&lt;/P&gt;
&lt;P&gt;Pipe command="mv "&amp;amp;file_path./Virage Survey.xml" "file_path./VirageSurvey.xml" 2&amp;gt;&amp;amp;1"&lt;/P&gt;
&lt;P&gt;mv: cannot stat '&amp;amp;file_path./Virage Survey.xml': No such file or directory&lt;BR /&gt;NOTE: 1 record was read from the infile OSCMD.&lt;BR /&gt;The minimum record length was 74.&lt;BR /&gt;The maximum record length was 74.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 14:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913791#M44235</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-01-31T14:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913792#M44236</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let file_path=/finsys/.../data;

filename oscmd pipe 'cd "&amp;amp;file_path." 2&amp;gt;&amp;amp;1';

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NOTE: The infile OSCMD is:&lt;BR /&gt;Pipe command="cd "&amp;amp;file_path." 2&amp;gt;&amp;amp;1"&lt;BR /&gt;2 The SAS System 08:43 Wednesday, January 31, 2024&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/bin/bash: line 0: cd: &amp;amp;file_path.: No such file or directory&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 14:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913792#M44236</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-01-31T14:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913794#M44237</link>
      <description>&lt;P&gt;Hello Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The use of the PIPE command was very usefull to diagnose the issue.&amp;nbsp; Thank you very much.&lt;/P&gt;
&lt;P&gt;Please, see the script below :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/** Renaming the XML File with SAS standard (no space in the file name) ***/

%let file_path=/finsys/.../data;
               
filename oscmd pipe "mv ""&amp;amp;file_path./Virage Survey.xml"" ""&amp;amp;file_path./VirageSurvey.xml"" 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jan 2024 14:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/913794#M44237</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-01-31T14:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a file using unix command mv</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/958615#M45817</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;Nice solution, with pipe it is the only way it worked for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Miguel.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 06:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-rename-a-file-using-unix-command-mv/m-p/958615#M45817</guid>
      <dc:creator>ldamar</dc:creator>
      <dc:date>2025-02-07T06:31:38Z</dc:date>
    </item>
  </channel>
</rss>

