<?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: Renaming a column after importing data from csv in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333385#M75108</link>
    <description>&lt;P&gt;Looks like a typo?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Practice vs prac&lt;STRONG&gt;itce&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2017 14:23:40 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-02-16T14:23:40Z</dc:date>
    <item>
      <title>Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333355#M75090</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very new to sas. I just imported a csv file and was wondering how I can rename a column. Thanks for your help. This was my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data pracitce.new1 (rename=(nationalid=nid));&lt;BR /&gt;set practice.new&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data= practice.new1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The imported file is now under practice.new. Is there a way to just modify the column on the parent file without creating a new file? &amp;nbsp;I got this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;98 data pracitce.new1 (rename=(nationalid=nid));&lt;BR /&gt;ERROR: Libref PRACITCE is not assigned.&lt;BR /&gt;99 set practice.new&lt;BR /&gt;100 run;&lt;BR /&gt;ERROR: File WORK.RUN.DATA does not exist.&lt;BR /&gt;101&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;102 proc print data= practice.new1;&lt;BR /&gt;103 run;&lt;/P&gt;&lt;P&gt;NOTE: No observations in data set PRACTICE.NEW1.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333355#M75090</guid>
      <dc:creator>byeh2017</dc:creator>
      <dc:date>2017-02-16T12:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333356#M75091</link>
      <description>&lt;P&gt;You did not assign your libref&amp;nbsp;&lt;SPAN&gt;PRACITCE right &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your rename statement looks right if you want to use the variable name nid in your data step.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to use the variable name&amp;nbsp;nationalid and then rename the variable in your output data set simply do&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pracitce.new1;
set practice.new

rename nationalid=nid
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333356#M75091</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-02-16T12:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333357#M75092</link>
      <description>&lt;P&gt;Thank you. How do I correctly assign the practice folder as my library? I thought I did that already before when I created the library folder... thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333357#M75092</guid>
      <dc:creator>byeh2017</dc:creator>
      <dc:date>2017-02-16T12:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333358#M75093</link>
      <description>&lt;P&gt;Like this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = insertyourpathhere; 
libname practice "&amp;amp;path";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333358#M75093</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-02-16T12:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333360#M75095</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to your question - yes you can rename a variable in a dataset without making a new dataset ... using PROC DATASETS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc datasets libname=practice;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*or pracitce if that is correct spelling*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; modify new;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; rename nationalid=nid;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333360#M75095</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-02-16T12:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333385#M75108</link>
      <description>&lt;P&gt;Looks like a typo?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Practice vs prac&lt;STRONG&gt;itce&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 14:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333385#M75108</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-16T14:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a column after importing data from csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333695#M75240</link>
      <description>&lt;P&gt;Yes, it was a typo! Thank you everyone.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 07:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Renaming-a-column-after-importing-data-from-csv/m-p/333695#M75240</guid>
      <dc:creator>byeh2017</dc:creator>
      <dc:date>2017-02-17T07:53:15Z</dc:date>
    </item>
  </channel>
</rss>

