<?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 multiple batches of variables in PROC SQL? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/360017#M10833</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116197"&gt;@NR13&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;You're right - definitely an "OR". When I try it, it changes the variables I need, but then repeats the changed variables with errors. So in my case, I'm using MEC1-MEC4 and adding the prefix of "R1_". This is what I'm getting in my log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Renaming variable MEC1 to R1_MEC1.&lt;BR /&gt;NOTE: Renaming variable MEC2 to R1_MEC2.&lt;BR /&gt;NOTE: Renaming variable MEC3 to R1_MEC3.&lt;BR /&gt;NOTE: Renaming variable MEC4 to R1_MEC4.&lt;BR /&gt;ERROR: Variable MEC1 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC2 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC3 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC4 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC1 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC2 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC3 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC4 is not on file WORK.R1.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Looks like either the selection code or the Proc datasets is pointing to the wrong dataset.&lt;/P&gt;
&lt;P&gt;POST the entire code that generates that error. Please use a code box such as opened using the forum {i} menu icon.&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2017 15:15:23 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-05-19T15:15:23Z</dc:date>
    <item>
      <title>How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359759#M10818</link>
      <description>&lt;P&gt;Hello! I know you can use the code below to rename varables that start with score, but is there a way to add the same suffix in the same dataset to another variable (without doing this twice)? i.e. "and upcase(name) like 'SCORE%' and upcase(name) like 'AGE%'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;48674 - Add a suffix or prefix to a group of variable names&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint; select cats(name,'=',name,'_OLD')&lt;BR /&gt;into :list&lt;BR /&gt;separated by ' '&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where libname = 'WORK' and memname = 'ONE'&lt;BR /&gt;and upcase(name) like 'SCORE%';&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc datasets library = work nolist;&lt;BR /&gt;modify one;&lt;BR /&gt;rename &amp;amp;list;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 18:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359759#M10818</guid>
      <dc:creator>NR13</dc:creator>
      <dc:date>2017-05-18T18:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359763#M10820</link>
      <description>&lt;P&gt;It should work fine, although it sounds like you are looking for OR rather than AND:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and (upcase(NAME) like ('SCORE%') or upcase(NAME) like ('AGE%'));&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 18:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359763#M10820</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-18T18:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359764#M10821</link>
      <description>&lt;P&gt;You're right - definitely an "OR". When I try it, it changes the variables I need, but then repeats the changed variables with errors. So in my case, I'm using MEC1-MEC4 and adding the prefix of "R1_". This is what I'm getting in my log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Renaming variable MEC1 to R1_MEC1.&lt;BR /&gt;NOTE: Renaming variable MEC2 to R1_MEC2.&lt;BR /&gt;NOTE: Renaming variable MEC3 to R1_MEC3.&lt;BR /&gt;NOTE: Renaming variable MEC4 to R1_MEC4.&lt;BR /&gt;ERROR: Variable MEC1 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC2 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC3 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC4 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC1 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC2 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC3 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC4 is not on file WORK.R1.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 19:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359764#M10821</guid>
      <dc:creator>NR13</dc:creator>
      <dc:date>2017-05-18T19:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359775#M10822</link>
      <description>&lt;P&gt;Something's definitely screwy with that ... looks like &amp;amp;LIST contains more than expected.&amp;nbsp; At a minimum, show what &amp;amp;LIST looks like.&amp;nbsp; That may lead you back to DICTIONARY.COLUMNS to revise how &amp;amp;LIST is created.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 19:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359775#M10822</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-18T19:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359804#M10825</link>
      <description>&lt;P&gt;Note that you really should check on your existing variable names before adding anything to them with a blind rename. If you are working with someone that likes to give variables names like This_is_a_longish_variable_name then you can well bump up against the character limits in a variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 20:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359804#M10825</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-18T20:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359879#M10829</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116197"&gt;@NR13&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Share your actual code which leads to this error.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 04:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/359879#M10829</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-05-19T04:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename multiple batches of variables in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/360017#M10833</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116197"&gt;@NR13&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;You're right - definitely an "OR". When I try it, it changes the variables I need, but then repeats the changed variables with errors. So in my case, I'm using MEC1-MEC4 and adding the prefix of "R1_". This is what I'm getting in my log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Renaming variable MEC1 to R1_MEC1.&lt;BR /&gt;NOTE: Renaming variable MEC2 to R1_MEC2.&lt;BR /&gt;NOTE: Renaming variable MEC3 to R1_MEC3.&lt;BR /&gt;NOTE: Renaming variable MEC4 to R1_MEC4.&lt;BR /&gt;ERROR: Variable MEC1 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC2 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC3 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC4 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC1 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC2 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC3 is not on file WORK.R1.&lt;BR /&gt;ERROR: Variable MEC4 is not on file WORK.R1.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Looks like either the selection code or the Proc datasets is pointing to the wrong dataset.&lt;/P&gt;
&lt;P&gt;POST the entire code that generates that error. Please use a code box such as opened using the forum {i} menu icon.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 15:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-rename-multiple-batches-of-variables-in-PROC-SQL/m-p/360017#M10833</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-19T15:15:23Z</dc:date>
    </item>
  </channel>
</rss>

