<?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: Renaming Multiple Files at Once in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890994#M352056</link>
    <description>&lt;P&gt;just use TRANWRD().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input oldname $200;
cards;
blah_blah_person.pdf
;

data want;
  set have;
   length newname $200;
   newname=tranwrd(oldname,'.pdf ','_2023.pdf');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now that you have both names you can use them to generate RENAME commands.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2023 13:54:22 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-08-25T13:54:22Z</dc:date>
    <item>
      <title>Renaming Multiple Files at Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890985#M352054</link>
      <description>Hey! I need a SAS program that will rename multiple files at once. Currently the files are names “blah_blah_person.pdf” and I need to update the files to “blah_blah_person_2023.pdf”. Is there a way to do this in SAS?&lt;BR /&gt;&lt;BR /&gt;Please note that “blah_blah_person” is different for each file, it’s not a consistent name for each. And each file is located in a folder on my windows computer.</description>
      <pubDate>Fri, 25 Aug 2023 13:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890985#M352054</guid>
      <dc:creator>mollywilk</dc:creator>
      <dc:date>2023-08-25T13:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Multiple Files at Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890994#M352056</link>
      <description>&lt;P&gt;just use TRANWRD().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input oldname $200;
cards;
blah_blah_person.pdf
;

data want;
  set have;
   length newname $200;
   newname=tranwrd(oldname,'.pdf ','_2023.pdf');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now that you have both names you can use them to generate RENAME commands.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 13:54:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890994#M352056</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-25T13:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Multiple Files at Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890997#M352057</link>
      <description>Would the rename all of the files in the folder at once?</description>
      <pubDate>Fri, 25 Aug 2023 14:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/890997#M352057</guid>
      <dc:creator>mollywilk</dc:creator>
      <dc:date>2023-08-25T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Multiple Files at Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/891004#M352061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/449094"&gt;@mollywilk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Would the rename all of the files in the folder at once?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To rename a series of files you need to:&lt;/P&gt;
&lt;P&gt;1) Get the names of the files.&lt;/P&gt;
&lt;P&gt;2) Generate the new name you want it to have.&lt;/P&gt;
&lt;P&gt;3) Issue a rename command for each file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What part of that are you having trouble with?&lt;/P&gt;
&lt;P&gt;What have you tried?&lt;/P&gt;
&lt;P&gt;How can you get a list of the files? (Hint that question has been asked hundreds of times on this site).&lt;/P&gt;
&lt;P&gt;I showed you how to generate a new name.&lt;/P&gt;
&lt;P&gt;How can you rename one file? What command can you use?&amp;nbsp; What would you do if it was just one file you had to rename?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 14:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-Multiple-Files-at-Once/m-p/891004#M352061</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-25T14:25:02Z</dc:date>
    </item>
  </channel>
</rss>

