<?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: rename command in a UNIX environment in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/251108#M17740</link>
    <description>&lt;P&gt;I think a similar program using SAS RENAME function would work in UNIX just as well as Windows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was fiddling with this one line bash script. &amp;nbsp;It does not exectue 'MV' just shows the command with ECHO. &amp;nbsp;It's really the same as your SAS program only different language. &amp;nbsp;I think most folk would do some kind of GREP thing but I'm not good with that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;PRE&gt; for file in x*.xml; do echo "Process: $file"; x=`basename $file .xml`; echo "mv $file ${x}.txt"; done;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;For each file that matches the pattern x*.xml&lt;/LI&gt;
&lt;LI&gt;print the file name&lt;/LI&gt;
&lt;LI&gt;assign x the filename with .xml removed&lt;/LI&gt;
&lt;LI&gt;print the mv command&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&amp;gt;for file in x*.xml; do echo "Process: $file"; x=`basename $file .xml`; echo "mv $file ${x}.txt"; done;
Process: xmltest.xml
mv xmltest.xml xmltest.txt
Process: xp1.xml
mv xp1.xml xp1.txt
Process: xp2.xml
mv xp2.xml xp2.txt
&lt;/PRE&gt;
&lt;P&gt;Assumes UNIX shell is BASH&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2016 13:21:18 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2016-02-19T13:21:18Z</dc:date>
    <item>
      <title>rename command in a UNIX environment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250802#M17716</link>
      <description>&lt;P&gt;I would like to rename multiple file extensions from EU to txt using the below code result &amp;nbsp;but I dont get the desired results.&lt;/P&gt;&lt;P&gt;Please note that I am using the UNIX environment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;BR /&gt;X 'rename /EIP/Data/Lev1/Data/FBM/.*EU /EIP/Data/Lev1/Data/FBM/*.txt';&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 13:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250802#M17716</guid>
      <dc:creator>natomajo</dc:creator>
      <dc:date>2016-02-18T13:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: rename command in a UNIX environment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250804#M17717</link>
      <description>&lt;P&gt;A couple of items to fix this ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, note that SAS does not require a DATA step in order to run the X command.&amp;nbsp; You only need one line of code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, note that you need a legitimate Unix command.&amp;nbsp; There is no "rename" command in Unix.&amp;nbsp; There is both "mv" and (I believe) "rnm".&amp;nbsp; So get your command working in Unix first, without using SAS.&amp;nbsp; Then it should be straightforward to convert it to a SAS X command.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 13:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250804#M17717</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-02-18T13:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: rename command in a UNIX environment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250868#M17722</link>
      <description>&lt;P&gt;Also you may want to double check the location of the wildcard character * in the source part of the command&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 16:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250868#M17722</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-18T16:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: rename command in a UNIX environment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250914#M17724</link>
      <description>&lt;P&gt;Do you really need to change the extension? &amp;nbsp;What will having the new extention get you that EU cannot provide.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 18:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/250914#M17724</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-18T18:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: rename command in a UNIX environment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/251035#M17735</link>
      <description>&lt;P&gt;I did not know that you can&amp;nbsp;an EU file using SAS, just tried it and it worked.&lt;/P&gt;&lt;P&gt;Really appreciated... But I would also like to know how to rename multiple files that resides in the same UNIX directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the below piece of code in windows environment and it worked..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename ren pipe "dir C:\Users\Desktop\FBM\FILES\NEW\*.EU /b /s";&lt;BR /&gt;/*To get the corresponding new file names*/&lt;BR /&gt;data ren;&lt;BR /&gt;infile ren;&lt;BR /&gt;input old : $250.;&lt;BR /&gt;new=tranwrd(old,".EU",'.TXT');&lt;BR /&gt;run;&lt;BR /&gt;/*To rename them all*/&lt;BR /&gt;data _null_;&lt;BR /&gt;set ren;&lt;BR /&gt;rc=rename(old, new, 'file');&lt;BR /&gt;put rc;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 07:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/251035#M17735</guid>
      <dc:creator>natomajo</dc:creator>
      <dc:date>2016-02-19T07:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: rename command in a UNIX environment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/251108#M17740</link>
      <description>&lt;P&gt;I think a similar program using SAS RENAME function would work in UNIX just as well as Windows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was fiddling with this one line bash script. &amp;nbsp;It does not exectue 'MV' just shows the command with ECHO. &amp;nbsp;It's really the same as your SAS program only different language. &amp;nbsp;I think most folk would do some kind of GREP thing but I'm not good with that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;PRE&gt; for file in x*.xml; do echo "Process: $file"; x=`basename $file .xml`; echo "mv $file ${x}.txt"; done;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;For each file that matches the pattern x*.xml&lt;/LI&gt;
&lt;LI&gt;print the file name&lt;/LI&gt;
&lt;LI&gt;assign x the filename with .xml removed&lt;/LI&gt;
&lt;LI&gt;print the mv command&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&amp;gt;for file in x*.xml; do echo "Process: $file"; x=`basename $file .xml`; echo "mv $file ${x}.txt"; done;
Process: xmltest.xml
mv xmltest.xml xmltest.txt
Process: xp1.xml
mv xp1.xml xp1.txt
Process: xp2.xml
mv xp2.xml xp2.txt
&lt;/PRE&gt;
&lt;P&gt;Assumes UNIX shell is BASH&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 13:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/rename-command-in-a-UNIX-environment/m-p/251108#M17740</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-19T13:21:18Z</dc:date>
    </item>
  </channel>
</rss>

