<?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: Change case of variable names for all data sets at a time with call execute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/305030#M65021</link>
    <description>&lt;P&gt;Oh, not label, variable name. &amp;nbsp;In which case why? &amp;nbsp;It matters not to programming if they are upper/lower/mixed case. &amp;nbsp;If you have an output spec to match to then I would suggest creating an emtpy table which matches your spec, then setting your data to that spec. &amp;nbsp;This has the benefits of having a fixed structure, and you can pull out any problems:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table MYOUT 
  ( 
    VAR1 char(200),
    VAR2 num
  );
quit;

data myout;
  set myout processed data;
run;&lt;/PRE&gt;</description>
    <pubDate>Mon, 17 Oct 2016 10:43:29 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-10-17T10:43:29Z</dc:date>
    <item>
      <title>Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304587#M64836</link>
      <description />
      <pubDate>Fri, 14 Oct 2016 10:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304587#M64836</guid>
      <dc:creator>SrikanthY</dc:creator>
      <dc:date>2016-10-14T10:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304592#M64838</link>
      <description>&lt;P&gt;Some tips on asking a question. &amp;nbsp;Whilst providing a descriptive title is great, providing some text in the post should also be done. &amp;nbsp; Provide example test data, in the form of a dataset, what you have tried, and what the output should look like. &amp;nbsp;At a guess:&lt;/P&gt;
&lt;PRE&gt;data a;
  a=1;
  b=2;
  label a="abcd";
  label b="ADer";
run;

data _null_;
  set sashelp.vcolumn (where=(libname="WORK" and memname="A")) end=last;
  if _n_=1 then call execute('proc datasets library=work noprint; modify a;');
  call execute (cat(' attrib ',strip(name),' label="',strip(upcase(label)),'";'));
  if last then call execute('run; quit;');
run;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Oct 2016 10:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304592#M64838</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-14T10:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304594#M64840</link>
      <description>&lt;P&gt;Is this just for presentation purposes? SAS isn't case sensitive when referring to variable names.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 10:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304594#M64840</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-14T10:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304606#M64847</link>
      <description>I wanted to change only variable names that to for multiple data sets.&lt;BR /&gt;&lt;BR /&gt;I have changed it for my convenience, but its displaying warning messages&lt;BR /&gt;on log. below is my code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set sashelp.vcolumn (where=(libname="WORK" and memname in ("ADOMSG"&lt;BR /&gt;"AIR"))) end=last;&lt;BR /&gt;if _n_=1 then call execute(catx(" ",'proc datasets library=work nolist;&lt;BR /&gt;modify',memname,';'));&lt;BR /&gt;call execute (cat(' attrib ','name="',strip(lowcase(name)),'"&lt;BR /&gt;label="',strip(upcase(label)),'";'));;&lt;BR /&gt;if last then call execute('run; quit;');&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;[image: Inline image 1]&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Fri, 14 Oct 2016 10:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304606#M64847</guid>
      <dc:creator>SrikanthY</dc:creator>
      <dc:date>2016-10-14T10:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304609#M64849</link>
      <description>&lt;P&gt;It would be &lt;U&gt;very&lt;/U&gt; helpful if you just copy/pasted the message(s) and the preceding code from the log into a {i} window.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 11:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304609#M64849</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-14T11:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304612#M64851</link>
      <description>&lt;P&gt;Then you need to break up the code into by groups, this is why posting test data/required output is helpful, we don't have to guess:&lt;/P&gt;
&lt;PRE&gt;data a;
  a=1;
  b=2;
  label a="abcd";
  label b="ADer";
run;
data b;
  a=1;
  b=2;
  label a="abcd";
  label b="ADer";
run;

data _null_;
  set sashelp.vcolumn (where=(libname="WORK" and memname in ("A","B")));
  by memname;
  if first.memname then call execute(cat('proc datasets library=work noprint; modify ',strip(memname),';'));
  call execute (cat(' attrib ',strip(name),' label="',strip(upcase(label)),'";'));
  if last.memname then call execute('run; quit;');
run;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Oct 2016 11:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304612#M64851</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-14T11:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304660#M64861</link>
      <description>&lt;P&gt;I think the issue somehow is valid.&lt;/P&gt;
&lt;P&gt;You could have decided for a specific notation, that includes casing - usually for better "readability".&lt;/P&gt;
&lt;P&gt;I don't have SAS at my fingertips right now, but I recall that I've tried to change the case of a variable/data&amp;nbsp;set name, but if all the letter where the same, it didn't take effect. Or...?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 13:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304660#M64861</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-10-14T13:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304662#M64862</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109740"&gt;@SrikanthY&lt;/a&gt; wrote:&lt;BR /&gt;I wanted to change only variable names that to for multiple data sets.&lt;BR /&gt;&lt;BR /&gt;I have changed it for my convenience, but its displaying warning messages&lt;BR /&gt;on log. below is my code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set sashelp.vcolumn (where=(libname="WORK" and memname in ("ADOMSG"&lt;BR /&gt;"AIR"))) end=last;&lt;BR /&gt;if _n_=1 then call execute(catx(" ",'proc datasets library=work nolist;&lt;BR /&gt;modify',memname,';'));&lt;BR /&gt;call execute (cat(' attrib ','name="',strip(lowcase(name)),'"&lt;BR /&gt;label="',strip(upcase(label)),'";'));;&lt;BR /&gt;if last then call execute('run; quit;');&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;[image: Inline image 1]&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That first line should have been in your first post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Images aren't attached when responding via email as noted - simple formatting, no attachments. You need to specifically upload your images to the forum.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 13:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304662#M64862</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-14T13:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304663#M64863</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I think the issue somehow is valid.&lt;/P&gt;
&lt;P&gt;You could have decided for a specific notation, that includes casing - usually for better "readability".&lt;/P&gt;
&lt;P&gt;I don't have SAS at my fingertips right now, but I recall that I've tried to change the case of a variable/data&amp;nbsp;set name, but if all the letter where the same, it didn't take effect. Or...?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It works with PROC DATASETS or the RENAME data set option but not the RENAME statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
   set sashelp.class;*(rename=(Name=NaMe));
   rename name=NaMe;
   run;
proc print;
   run;
proc datasets lib=work;
   modify class;
   rename Name=name;
   run;
proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Oct 2016 13:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304663#M64863</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-10-14T13:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304853#M64937</link>
      <description>&lt;PRE&gt;

data a;
  a=1;
  b=2;
  label a="abcd";
  label b="ADer";
run;
data b;
  a=1;
  b=2;
  label a="abcd";
  label b="ADer";
run;

data _null_;
  set sashelp.vcolumn (where=(lowcase(name)='a')) end=last;
  call execute(cat('proc datasets library=',libname,' nolist nodetails;'));
  call execute(cat('modify ',memname,'; rename ',name,'=new_',name,';quit;'));
run;


&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Oct 2016 06:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304853#M64937</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-15T06:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304989#M65010</link>
      <description>Variable name is not changed low-case to up-case&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Mon, 17 Oct 2016 07:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/304989#M65010</guid>
      <dc:creator>SrikanthY</dc:creator>
      <dc:date>2016-10-17T07:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/305028#M65019</link>
      <description>&lt;P&gt;It depends on your OS, maybe you can't do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=upcase;
data class;
 set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Oct 2016 10:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/305028#M65019</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-17T10:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change case of variable names for all data sets at a time with call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/305030#M65021</link>
      <description>&lt;P&gt;Oh, not label, variable name. &amp;nbsp;In which case why? &amp;nbsp;It matters not to programming if they are upper/lower/mixed case. &amp;nbsp;If you have an output spec to match to then I would suggest creating an emtpy table which matches your spec, then setting your data to that spec. &amp;nbsp;This has the benefits of having a fixed structure, and you can pull out any problems:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table MYOUT 
  ( 
    VAR1 char(200),
    VAR2 num
  );
quit;

data myout;
  set myout processed data;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Oct 2016 10:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-case-of-variable-names-for-all-data-sets-at-a-time-with/m-p/305030#M65021</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-17T10:43:29Z</dc:date>
    </item>
  </channel>
</rss>

