<?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 multiple variables with same prefix in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843198#M36571</link>
    <description>&lt;P&gt;Thank you for your help! however, it is still not working.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="log.PNG" style="width: 704px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77095i6D1D1365E60E6EF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="log.PNG" alt="log.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 17:44:40 GMT</pubDate>
    <dc:creator>knighsson</dc:creator>
    <dc:date>2022-11-08T17:44:40Z</dc:date>
    <item>
      <title>rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843189#M36567</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset "nh.weekday1" that contains many variables starting with "dr1" such as "dr1drs" and "dr1_tak", I want to rename those variables starting with "wkdy", so they become "wkdydrs" and "wkdy_tak". My code and log are below. Could you please tell me what went wrong and how to fix it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="log.PNG" style="width: 726px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77094i58156941F0F5459F/image-size/large?v=v2&amp;amp;px=999" role="button" title="log.PNG" alt="log.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select cats(name,"=",tranwrd(name,"dr1","wkdy")) into :renames separated by " "
   from dictionary.columns
   where libname="NH" 
     and memname="weekday1"
     and name like "dr1";
quit;

proc datasets library=nh nolist;
    modify weekday1;
    rename &amp;amp;renames;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843189#M36567</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2022-11-08T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843192#M36568</link>
      <description>&lt;P&gt;Keep in mind that memname, like libname, is uppercase in the DICTIONARY tables. For most values in name, this will also be true, so you should convert it with UPCASE and compare with "DR1".&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843192#M36568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-08T17:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843193#M36569</link>
      <description>&lt;P&gt;Your SQL log says "NOTE: No rows selected". So your WHERE clause is not finding any hits in the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you don't have the proper capitalization. MEMNAME and NAME should be all capital letters.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843193#M36569</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-08T17:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843195#M36570</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/317476"&gt;@knighsson&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to the wrong case of &lt;FONT face="courier new,courier"&gt;"weekday1"&lt;/FONT&gt; you missed the wildcard character (%) in the LIKE condition:&lt;/P&gt;
&lt;PRE&gt;and name like "dr1&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;%&lt;/STRONG&gt;&lt;/FONT&gt;"&lt;/PRE&gt;
&lt;P&gt;which could also be written as&lt;/P&gt;
&lt;PRE&gt;and name &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;eqt&lt;/STRONG&gt;&lt;/FONT&gt; "dr1"&lt;/PRE&gt;
&lt;P&gt;(analogous for &lt;FONT face="courier new,courier"&gt;upcase(name)&lt;/FONT&gt;, if needed).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843195#M36570</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-11-08T17:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843198#M36571</link>
      <description>&lt;P&gt;Thank you for your help! however, it is still not working.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="log.PNG" style="width: 704px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77095i6D1D1365E60E6EF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="log.PNG" alt="log.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843198#M36571</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2022-11-08T17:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843199#M36572</link>
      <description>Thank you so much!! This is it!&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Tue, 08 Nov 2022 17:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843199#M36572</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2022-11-08T17:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: rename multiple variables with same prefix</title>
      <link>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843200#M36573</link>
      <description>Thank you!</description>
      <pubDate>Tue, 08 Nov 2022 17:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/rename-multiple-variables-with-same-prefix/m-p/843200#M36573</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2022-11-08T17:46:22Z</dc:date>
    </item>
  </channel>
</rss>

