<?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 Rename a variable that has a space in it in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796932#M255789</link>
    <description>&lt;P&gt;the variable has a space in it, I checked using proc contents and both the label and var name have a space in them. I tried renaming using the rename option&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the error I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;77 rename education level = education_level;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Alphabetic prefixes for enumerated variables (education-level) are different.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Old and new variable name specifications for RENAME must be of the same type. Statement is ignored.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR 79-322: Expecting a -.&lt;/DIV&gt;</description>
    <pubDate>Thu, 17 Feb 2022 17:32:11 GMT</pubDate>
    <dc:creator>ayosas</dc:creator>
    <dc:date>2022-02-17T17:32:11Z</dc:date>
    <item>
      <title>Rename a variable that has a space in it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796932#M255789</link>
      <description>&lt;P&gt;the variable has a space in it, I checked using proc contents and both the label and var name have a space in them. I tried renaming using the rename option&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the error I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;77 rename education level = education_level;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Alphabetic prefixes for enumerated variables (education-level) are different.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Old and new variable name specifications for RENAME must be of the same type. Statement is ignored.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR 79-322: Expecting a -.&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Feb 2022 17:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796932#M255789</guid>
      <dc:creator>ayosas</dc:creator>
      <dc:date>2022-02-17T17:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable that has a space in it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796934#M255791</link>
      <description>&lt;P&gt;For non-standard names, you have to use name literals:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rename 'education level'n = education_level;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Feb 2022 17:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796934#M255791</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-17T17:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable that has a space in it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796935#M255792</link>
      <description>&lt;P&gt;You need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then you can rename with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rename 'education level'n = education_level;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;notice the quotes and the letter &lt;FONT face="courier new,courier"&gt;n&lt;/FONT&gt; after the final quote&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 17:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796935#M255792</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-17T17:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable that has a space in it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796936#M255793</link>
      <description>&lt;P&gt;PS you can avoid this by issuing&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname = v7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before importing the data into SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 17:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796936#M255793</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-17T17:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable that has a space in it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796994#M255807</link>
      <description>&lt;P&gt;So if this is an excel file, this option should go before proc import?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 19:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/796994#M255807</guid>
      <dc:creator>ayosas</dc:creator>
      <dc:date>2022-02-17T19:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rename a variable that has a space in it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/797025#M255811</link>
      <description>&lt;P&gt;Yes. SAS will then convert the names to valid SAS names by replacing invalid characters with underlines.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 19:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rename-a-variable-that-has-a-space-in-it/m-p/797025#M255811</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-17T19:29:18Z</dc:date>
    </item>
  </channel>
</rss>

