<?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 Rename With Capitals in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510400#M1945</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/244608"&gt;@bradklassen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like it in that format for the purpose of exporting it to Tableau. I already have some tableau calculated fields created that reference Run_Number rather than run_number. Tableau will not identify that they are supposed to be the same columns.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oh yes. See the second part of my previous post.&lt;/P&gt;
&lt;P&gt;OTOH, SQL and PL/1 (on which the data step language is modeled) are also case insensitive.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Nov 2018 14:28:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-11-05T14:28:23Z</dc:date>
    <item>
      <title>SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510374#M1940</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having a problem renaming columns with capitals. SAS will only capitalize the variables that are different on the left and right of the equal signs. I would like to rename a variable exactly the same just with capitals. Ex. I would like run_number to become Run_Number. However, SAS will not recognize the command and leave the variable name as run_number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have provided the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temp.GPS_Edit5 (rename =(lightbeam=_Lightbeam run_number=Run_Number last_name=Last_Name first_name=First_Name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;discipline=Discipline distance_m=_Distance_m speed_kmh=_Speed_km_h&amp;nbsp;roll_angle=_Roll_angle lightbeam_time_s=_LB_time_s&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;corr_z=Corr_z));&lt;BR /&gt;set temp.GPS_Edit4;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 13:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510374#M1940</guid>
      <dc:creator>bradklassen</dc:creator>
      <dc:date>2018-11-05T13:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510380#M1941</link>
      <description>&lt;P&gt;What for? For code, run_number and Run_number are 100 % equal.&lt;/P&gt;
&lt;P&gt;If you want to have something nice to read, put in in a label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Allowing upper- and lowercase without making the whole language case-sensitive is one of the blunders SAS has committed over the years, IMO.&lt;/P&gt;
&lt;P&gt;C, C++, C#, Java, Python, Go, Ruby are all case sensitive.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 13:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510380#M1941</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-05T13:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510386#M1942</link>
      <description>&lt;P&gt;I would like it in that format for the purpose of exporting it to Tableau. I already have some tableau calculated fields created that reference Run_Number rather than run_number. Tableau will not identify that they are supposed to be the same columns.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 13:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510386#M1942</guid>
      <dc:creator>bradklassen</dc:creator>
      <dc:date>2018-11-05T13:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510387#M1943</link>
      <description>&lt;P&gt;Did you try renaming on the way in instead of on the way out?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  run_number=1;
  length name $32 ;
  name=vnamex('run_number');
  put (_all_) (=);
run;
data want ;
  set have(rename=(run_number=Run_Number));
  name=vnamex('run_number');
  put (_all_) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;296  data have;
297    run_number=1;
298    length name $32 ;
299    name=vnamex('run_number');
300    put (_all_) (=);
301  run;

run_number=1 name=run_number
NOTE: The data set WORK.HAVE has 1 observations and 2 variables.


302  data want ;
303    set have(rename=(run_number=Run_Number));
304    name=vnamex('run_number');
305    put (_all_) (=);
306  run;

Run_Number=1 name=Run_Number
NOTE: There were 1 observations read from the data set WORK.HAVE.
NOTE: The data set WORK.WANT has 1 observations and 2 variables.&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Nov 2018 13:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510387#M1943</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-05T13:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510389#M1944</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; use labels that is why SAS has labels, so you can see the names without the underscores and uppercase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;those labels also help those who don't know the data putting the Caps in here and there will not assist in the final outcome.&lt;/P&gt;
&lt;P&gt;Use the right tool for the job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 14:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510389#M1944</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-05T14:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510400#M1945</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/244608"&gt;@bradklassen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like it in that format for the purpose of exporting it to Tableau. I already have some tableau calculated fields created that reference Run_Number rather than run_number. Tableau will not identify that they are supposed to be the same columns.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oh yes. See the second part of my previous post.&lt;/P&gt;
&lt;P&gt;OTOH, SQL and PL/1 (on which the data step language is modeled) are also case insensitive.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 14:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510400#M1945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-05T14:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Rename With Capitals</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510425#M1946</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/244608"&gt;@bradklassen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only rename variables, you don't need to read the data with a SET statement, which can be time-consuming for a large dataset. It's more efficient to use PROC DATASETS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data GPS_Edit4;
run_number=1;
corr_z=2;
speed_kmh=3;
run;

proc datasets lib=work nolist; /* in your case: lib=temp */
modify GPS_Edit4;
rename run_number=Run_Number corr_z=Corr_z speed_kmh=_Speed_km_h;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need the SET statement anyway, you can use the RETAIN statement (&lt;EM&gt;before&lt;/EM&gt;&amp;nbsp;the SET statement) and thus shorten the RENAME= dataset option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data GPS_Edit5;
retain Run_Number Corr_z;
set GPS_Edit4(rename=(speed_kmh=_Speed_km_h));
* ... more statements ...;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Nov 2018 14:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Rename-With-Capitals/m-p/510425#M1946</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-05T14:52:12Z</dc:date>
    </item>
  </channel>
</rss>

