<?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: SAS special character in column names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704819#M216096</link>
    <description>&lt;P&gt;Did the "import" already run successfully?&amp;nbsp; What is the name used for the variable in the resulting SAS dataset.&amp;nbsp; Use PROC CONTENTS or other way of looking at the actual name. Don't just look at what you see in some viewer or PROC output as that might be displaying the label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the SAS option VALIDVARNAME set to ANY then you can use a Name Literal to reference that goofy name.&amp;nbsp; So if your SAS dataset is named WORK.MYDATA then you could rename the variable this way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=WORK nolist;
modify MYDATA ;
  rename 'age_10+'n=age_10plus&amp;nbsp;;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have VALIDVARNAME=V7 then the name was probably already fixed by replacing invalid bytes with underscores.&amp;nbsp; So most likely it is named AGE_10_&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2020 17:48:51 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-12-09T17:48:51Z</dc:date>
    <item>
      <title>SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704814#M216093</link>
      <description>&lt;P&gt;I have column name as age_10+, how would I rename that var in sas as it's already been imported&amp;nbsp; via teradata connection. Any help is really appreciated .&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 17:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704814#M216093</guid>
      <dc:creator>LearnByMistk</dc:creator>
      <dc:date>2020-12-09T17:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704818#M216095</link>
      <description>data a;&lt;BR /&gt;rename age_10+=age_10_p;&lt;BR /&gt; set b;&lt;BR /&gt; run;</description>
      <pubDate>Wed, 09 Dec 2020 17:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704818#M216095</guid>
      <dc:creator>LearnByMistk</dc:creator>
      <dc:date>2020-12-09T17:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704819#M216096</link>
      <description>&lt;P&gt;Did the "import" already run successfully?&amp;nbsp; What is the name used for the variable in the resulting SAS dataset.&amp;nbsp; Use PROC CONTENTS or other way of looking at the actual name. Don't just look at what you see in some viewer or PROC output as that might be displaying the label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the SAS option VALIDVARNAME set to ANY then you can use a Name Literal to reference that goofy name.&amp;nbsp; So if your SAS dataset is named WORK.MYDATA then you could rename the variable this way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=WORK nolist;
modify MYDATA ;
  rename 'age_10+'n=age_10plus&amp;nbsp;;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have VALIDVARNAME=V7 then the name was probably already fixed by replacing invalid bytes with underscores.&amp;nbsp; So most likely it is named AGE_10_&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 17:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704819#M216096</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-09T17:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704823#M216097</link>
      <description>options  VALIDVARNAME=V7 ;&lt;BR /&gt;data a;&lt;BR /&gt;29         rename AGE_85_+_PCT=age_85_plus;&lt;BR /&gt;ERROR: Missing numeric suffix on a numbered variable list (AGE_85_-_PCT).&lt;BR /&gt;ERROR: Old and new variable name specifications for RENAME must be of the same type. Statement is ignored.&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: -, :, =.  &lt;BR /&gt;&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.</description>
      <pubDate>Wed, 09 Dec 2020 18:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704823#M216097</guid>
      <dc:creator>LearnByMistk</dc:creator>
      <dc:date>2020-12-09T18:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704829#M216099</link>
      <description>&lt;P&gt;You need to use a&amp;nbsp;&lt;EM&gt;name literal&lt;/EM&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rename 'age_10+'n=age_10_p;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Dec 2020 18:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704829#M216099</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-09T18:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704834#M216102</link>
      <description>&lt;P&gt;VALIDVARNAME is only relevant when importing data into SAS. Once your non-standard variable names are in SAS then you have to reference them as name literals as already explained.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 18:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704834#M216102</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-12-09T18:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS special character in column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704889#M216124</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;29 rename AGE_85_+_PCT=age_85_plus;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR: Missing numeric suffix on a numbered variable list (AGE_85_-_PCT).&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This code is &lt;EM&gt;not&lt;/EM&gt; what was provided to you as a solution.&lt;/P&gt;
&lt;P&gt;You have to enclose the variable name inside&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT face="courier new,courier"&gt;'&amp;nbsp; 'n&lt;/FONT&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;as shown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 23:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-special-character-in-column-names/m-p/704889#M216124</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-09T23:14:19Z</dc:date>
    </item>
  </channel>
</rss>

