<?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 a variable from results output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914338#M360278</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;

data have;
input estimate_ID std_ID 'estimate_ID(group)'n 'std_ID(group)'n;
cards;
23	2	45	3
;
run;

proc datasets library=work NoList NoDetails memtype=data; 
 modify have;
  rename 'estimate_ID(group)'n = abc;
  rename 'std_ID(group)'n      = xyz; run;
QUIT;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2024 21:54:42 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2024-02-02T21:54:42Z</dc:date>
    <item>
      <title>Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914327#M360275</link>
      <description>&lt;P&gt;One of the variable names from results output has a parenthesis, i.e., ID(group). How can I rename the variable? Rename does not work.&lt;/P&gt;&lt;P&gt;I needed to transpose from long to wide the results output but when I wanted to rename id(group) it does not work. This is what the output looks like:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Subject&lt;/TD&gt;&lt;TD&gt;estimate&lt;/TD&gt;&lt;TD&gt;standard Error&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ID(group)&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This is the transposed result:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;estimate_ID&lt;/TD&gt;&lt;TD&gt;std_ID&lt;/TD&gt;&lt;TD&gt;estimate_ID(group)&lt;/TD&gt;&lt;TD&gt;std_ID(group)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 02 Feb 2024 21:31:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914327#M360275</guid>
      <dc:creator>ANKH1</dc:creator>
      <dc:date>2024-02-02T21:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914338#M360278</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;

data have;
input estimate_ID std_ID 'estimate_ID(group)'n 'std_ID(group)'n;
cards;
23	2	45	3
;
run;

proc datasets library=work NoList NoDetails memtype=data; 
 modify have;
  rename 'estimate_ID(group)'n = abc;
  rename 'std_ID(group)'n      = xyz; run;
QUIT;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 21:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914338#M360278</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-02-02T21:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914339#M360279</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226521"&gt;@ANKH1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To reference a variable containing a special character in SAS, you need to put the variable name in quotes followed by a letter n. Try this line of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rename 'estimate_ID(group)'n=new_name;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Joshua&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 21:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914339#M360279</guid>
      <dc:creator>mtnbikerjoshua</dc:creator>
      <dc:date>2024-02-02T21:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914342#M360282</link>
      <description>&lt;P&gt;Provide data prior to the Proc Transpose in the form of a working data step and the Proc Transpose code you used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will (and likely should) fix the data before the transpose. Since you did not provide the Transpose code I have to guess that you used and ID statement which means that the "problem" lies in the value of the Subject variable if that was used in the&amp;nbsp; ID statement. But you have some other questionable things as well, so an example data set is needed.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 21:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914342#M360282</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-02-02T21:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914344#M360284</link>
      <description>&lt;P&gt;In the first dataset "ID(group)" is a value, so you need a normal assignment to change the value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if Subject = "ID(group)" then Subject = "id_group";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Added forgotten quotes.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 22:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914344#M360284</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2024-02-02T22:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914351#M360288</link>
      <description>Thanks also for explaining!</description>
      <pubDate>Fri, 02 Feb 2024 22:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914351#M360288</guid>
      <dc:creator>ANKH1</dc:creator>
      <dc:date>2024-02-02T22:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable from results output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914352#M360289</link>
      <description>&lt;P&gt;Oh right! This also works!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 22:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-from-results-output/m-p/914352#M360289</guid>
      <dc:creator>ANKH1</dc:creator>
      <dc:date>2024-02-02T22:13:26Z</dc:date>
    </item>
  </channel>
</rss>

