<?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 Why does my variable keep the old label after a rename? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541618#M149564</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I ran into a problem that took a long time to debug.&amp;nbsp; I renamed a variable so that it would contain spaces when displayed in SASVA.&amp;nbsp; I know that there are other ways to do this, but I needed to keep the variable names consistent with data that was previously uploaded in Excel.&lt;BR /&gt;&lt;BR /&gt;This does not seem to happen all the time (though I could be wrong).&amp;nbsp; I would just like to understand when I can expect this to happen and why.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Data New_Table;&lt;BR /&gt;&lt;BR /&gt;Set Old_Table;&lt;BR /&gt;&lt;BR /&gt;Rename Variable_Name = 'Variable Name'n;&lt;BR /&gt;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Results:&amp;nbsp; Appears as Variable Name in my output, but when I hover over the column header, it shows that I have a label that is Variable_Name.&lt;BR /&gt;&lt;BR /&gt;When this goes to SASVA, it appears as Variable_Name but when I hover over (or maybe right click) it lists the source variable as Variable Name.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FWIW, I fixed it by creating a new variable, making it = to the old variable, and then dropping the old variable.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2019 21:21:50 GMT</pubDate>
    <dc:creator>BarryP</dc:creator>
    <dc:date>2019-03-08T21:21:50Z</dc:date>
    <item>
      <title>Why does my variable keep the old label after a rename?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541618#M149564</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I ran into a problem that took a long time to debug.&amp;nbsp; I renamed a variable so that it would contain spaces when displayed in SASVA.&amp;nbsp; I know that there are other ways to do this, but I needed to keep the variable names consistent with data that was previously uploaded in Excel.&lt;BR /&gt;&lt;BR /&gt;This does not seem to happen all the time (though I could be wrong).&amp;nbsp; I would just like to understand when I can expect this to happen and why.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Data New_Table;&lt;BR /&gt;&lt;BR /&gt;Set Old_Table;&lt;BR /&gt;&lt;BR /&gt;Rename Variable_Name = 'Variable Name'n;&lt;BR /&gt;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Results:&amp;nbsp; Appears as Variable Name in my output, but when I hover over the column header, it shows that I have a label that is Variable_Name.&lt;BR /&gt;&lt;BR /&gt;When this goes to SASVA, it appears as Variable_Name but when I hover over (or maybe right click) it lists the source variable as Variable Name.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FWIW, I fixed it by creating a new variable, making it = to the old variable, and then dropping the old variable.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 21:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541618#M149564</guid>
      <dc:creator>BarryP</dc:creator>
      <dc:date>2019-03-08T21:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my variable keep the old label after a rename?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541622#M149566</link>
      <description>&lt;P&gt;if you do not create a label for a variable SAS deflates to naming the labels with the variable name.&lt;/P&gt;
&lt;P&gt;when you rename a variable only the variable name is changed and the old label is inherited.&lt;/P&gt;
&lt;P&gt;to get what you are expecting use a label statement to label that variable to what you want it to display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 21:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541622#M149566</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-08T21:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my variable keep the old label after a rename?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541632#M149569</link>
      <description>&lt;P&gt;Why would SAS change the label if all you did was change the name?&lt;/P&gt;
&lt;P&gt;You could set the new label.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data New_Table;
  set Old_Table;
  rename Variable_Name = 'Variable Name'n;
  label Variable_Name = 'Variable Name';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or perhaps just remove the old one.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data New_Table;
  set Old_Table;
  rename Variable_Name = 'Variable Name'n;
  label Variable_Name = ' ';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2019 22:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-my-variable-keep-the-old-label-after-a-rename/m-p/541632#M149569</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-08T22:05:49Z</dc:date>
    </item>
  </channel>
</rss>

