<?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 a SAS dataset column with parantheses in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480205#M124084</link>
    <description>&lt;P&gt;When column names are imported that do not conform to the SAS standard then you can rename them like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Test1; 
	set Work.System(rename = ('System Power Output(W)'n = SystemPowOutInW)); 
Run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 22 Jul 2018 01:42:51 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2018-07-22T01:42:51Z</dc:date>
    <item>
      <title>How to rename a SAS dataset column with parantheses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480203#M124083</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; This is probably a simple way to achieve what I want but I don't know how to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am importing some data from a csv file using the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc import datafile=csv out=System dbms=csv replace; 
/* 		getnames=yes; */   *since imported names have parantheses or special characters;
	run;
	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; As shown in the commented code, I have tried commenting the options of getnames out and tried it with the code turned on. Either ways the imported data set has variables that are not being recognized with the rename option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When attempting to rename :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Test1; 
	set Work.System(rename = System Power Output(W) = SystemPowOutInW); 
Run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 79-322: Expecting a =.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-7: Invalid option name =.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;When attempting to make subset of dataset&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Test1; 
	set Work.System(keep = System Power Output(W) = SystemPowOutInW); 
Run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;DIV class="sasError"&gt;ERROR 214-322: Variable name ( is not valid.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 23-7: Invalid value for the KEEP option.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Is there a way to make the column names SAS compliant when importing them from the CSV or can someone demonstrate an example of renaming column names with parantheses and special characters ?&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 22 Jul 2018 01:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480203#M124083</guid>
      <dc:creator>UdayGuntupalli</dc:creator>
      <dc:date>2018-07-22T01:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a SAS dataset column with parantheses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480205#M124084</link>
      <description>&lt;P&gt;When column names are imported that do not conform to the SAS standard then you can rename them like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Test1; 
	set Work.System(rename = ('System Power Output(W)'n = SystemPowOutInW)); 
Run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Jul 2018 01:42:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480205#M124084</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-07-22T01:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a SAS dataset column with parantheses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480206#M124085</link>
      <description>&lt;P&gt;Set the following option and rerun your import code.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Options validvarname=V7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS should automatically convert the names into cleaner names.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jul 2018 01:53:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-SAS-dataset-column-with-parantheses/m-p/480206#M124085</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-22T01:53:57Z</dc:date>
    </item>
  </channel>
</rss>

