<?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: UPCASE ALL VARIABLES IN DATASET in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31266#M7435</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Here is a sample code I created to do the job &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
You just need to update the parameters which are passed into the macro call.&lt;BR /&gt;
&lt;BR /&gt;
Enjoy !&lt;BR /&gt;
&lt;BR /&gt;
Kind regards,&lt;BR /&gt;
Florent&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%MACRO UpcaseCharVar(lib, ds);		/* lib: library's name 		   &lt;BR /&gt;
		    							ds: dataset's name */&lt;BR /&gt;
	proc sql noprint;&lt;BR /&gt;
		select count(distinct name)&lt;BR /&gt;
		into :NbrCharVar&lt;BR /&gt;
		from dictionary.columns&lt;BR /&gt;
		where libname = upcase("&amp;amp;lib")&lt;BR /&gt;
		  and memname = upcase("&amp;amp;ds")&lt;BR /&gt;
		  and type = 'char';&lt;BR /&gt;
	quit;&lt;BR /&gt;
&lt;BR /&gt;
	%let NbrCharVar = &amp;amp;NbrCharVar;	/* Removes Leading and Trailing Blanks */&lt;BR /&gt;
&lt;BR /&gt;
	proc sql noprint;&lt;BR /&gt;
		select name&lt;BR /&gt;
		into :CharVar1-:CharVar&amp;amp;NbrCharVar&lt;BR /&gt;
		from dictionary.columns&lt;BR /&gt;
		where libname = upcase("&amp;amp;lib")&lt;BR /&gt;
		  and memname = upcase("&amp;amp;ds")&lt;BR /&gt;
		  and type = 'char';&lt;BR /&gt;
	quit;&lt;BR /&gt;
&lt;BR /&gt;
	%IF &amp;amp;NbrCharVar &amp;gt; 0 %THEN&lt;BR /&gt;
		%DO i=1 %TO &amp;amp;NbrCharVar;&lt;BR /&gt;
		proc sql;&lt;BR /&gt;
			update &amp;amp;lib..&amp;amp;ds&lt;BR /&gt;
			set &amp;amp;&amp;amp;CharVar&amp;amp;i = upcase(&amp;amp;&amp;amp;CharVar&amp;amp;i);&lt;BR /&gt;
		quit;&lt;BR /&gt;
		%END;&lt;BR /&gt;
%MEND;&lt;BR /&gt;
&lt;BR /&gt;
%UpcaseCharVar(Work, Test_DS);</description>
    <pubDate>Thu, 14 May 2009 11:14:31 GMT</pubDate>
    <dc:creator>Florent</dc:creator>
    <dc:date>2009-05-14T11:14:31Z</dc:date>
    <item>
      <title>UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31263#M7432</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I was wondering if anyone can supply code that allows me to UPCASE all variables in a dataset.&lt;BR /&gt;
&lt;BR /&gt;
Currently i have a macro which loops through each of the names and upcases them 1 at a time in a data step.&lt;BR /&gt;
&lt;BR /&gt;
I was hoping there was an easier way to do this.&lt;BR /&gt;
&lt;BR /&gt;
Like so&lt;BR /&gt;
&lt;BR /&gt;
proc datasets library = cwork nodetails ;&lt;BR /&gt;
contents noprint data = &amp;amp;final_name  out = work.test3 ;&lt;BR /&gt;
run;quit;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
select Count(*)&lt;BR /&gt;
into :No_obs&lt;BR /&gt;
from test3;&lt;BR /&gt;
select NAME&lt;BR /&gt;
into :KEEP_VAR1-:KEEP_VAR%left(&amp;amp;No_obs)&lt;BR /&gt;
from test3;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%do k=1 %to &amp;amp;No_obs;&lt;BR /&gt;
&lt;BR /&gt;
    %let Keep_Var1 = &amp;amp;Keep_Var&amp;amp;k;&lt;BR /&gt;
&lt;BR /&gt;
data cwork.&amp;amp;final_name;&lt;BR /&gt;
set cwork.&amp;amp;final_name;&lt;BR /&gt;
&amp;amp;Keep_Var1 = upcase(&amp;amp;Keep_Var1);&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 13 May 2009 09:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31263#M7432</guid>
      <dc:creator>Doyleuk</dc:creator>
      <dc:date>2009-05-13T09:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31264#M7433</link>
      <description>There are no syntax available to my knowledge that will do this.&lt;BR /&gt;
But I think you are on the right track.&lt;BR /&gt;
You could either in your SQL and perhaps by subsequent string manipulation prepare UPCASE assignments for all variables, &lt;BR /&gt;
or do your macro loop inside your data step so you don't have to rewrite your SAS table for each variable to upcase.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 13 May 2009 10:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31264#M7433</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-05-13T10:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31265#M7434</link>
      <description>From what you have explained, it appears that you want to UPCASE the variable "values", not the variable "names" in your SAS datasets.  You can use a DATA step with an ARRAY and reference _CHARACTER_ as the list of variables in the ARRAY.  Then code a DO I=1 TO DIM(&lt;ARRAYNAME&gt;);  END;  and do your UPCASE re-assignment.&lt;BR /&gt;
&lt;BR /&gt;
You will find useful topic-oriented information at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website, using the SEARCH facility.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
SAS 9.2 DOC: Array Processing&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002299816.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002299816.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Variations on Basic Array Processing&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000739610.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000739610.htm&lt;/A&gt;&lt;/ARRAYNAME&gt;</description>
      <pubDate>Wed, 13 May 2009 12:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31265#M7434</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-13T12:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31266#M7435</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Here is a sample code I created to do the job &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
You just need to update the parameters which are passed into the macro call.&lt;BR /&gt;
&lt;BR /&gt;
Enjoy !&lt;BR /&gt;
&lt;BR /&gt;
Kind regards,&lt;BR /&gt;
Florent&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%MACRO UpcaseCharVar(lib, ds);		/* lib: library's name 		   &lt;BR /&gt;
		    							ds: dataset's name */&lt;BR /&gt;
	proc sql noprint;&lt;BR /&gt;
		select count(distinct name)&lt;BR /&gt;
		into :NbrCharVar&lt;BR /&gt;
		from dictionary.columns&lt;BR /&gt;
		where libname = upcase("&amp;amp;lib")&lt;BR /&gt;
		  and memname = upcase("&amp;amp;ds")&lt;BR /&gt;
		  and type = 'char';&lt;BR /&gt;
	quit;&lt;BR /&gt;
&lt;BR /&gt;
	%let NbrCharVar = &amp;amp;NbrCharVar;	/* Removes Leading and Trailing Blanks */&lt;BR /&gt;
&lt;BR /&gt;
	proc sql noprint;&lt;BR /&gt;
		select name&lt;BR /&gt;
		into :CharVar1-:CharVar&amp;amp;NbrCharVar&lt;BR /&gt;
		from dictionary.columns&lt;BR /&gt;
		where libname = upcase("&amp;amp;lib")&lt;BR /&gt;
		  and memname = upcase("&amp;amp;ds")&lt;BR /&gt;
		  and type = 'char';&lt;BR /&gt;
	quit;&lt;BR /&gt;
&lt;BR /&gt;
	%IF &amp;amp;NbrCharVar &amp;gt; 0 %THEN&lt;BR /&gt;
		%DO i=1 %TO &amp;amp;NbrCharVar;&lt;BR /&gt;
		proc sql;&lt;BR /&gt;
			update &amp;amp;lib..&amp;amp;ds&lt;BR /&gt;
			set &amp;amp;&amp;amp;CharVar&amp;amp;i = upcase(&amp;amp;&amp;amp;CharVar&amp;amp;i);&lt;BR /&gt;
		quit;&lt;BR /&gt;
		%END;&lt;BR /&gt;
%MEND;&lt;BR /&gt;
&lt;BR /&gt;
%UpcaseCharVar(Work, Test_DS);</description>
      <pubDate>Thu, 14 May 2009 11:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31266#M7435</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2009-05-14T11:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31267#M7436</link>
      <description>Many Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Your code worked a treat</description>
      <pubDate>Fri, 15 May 2009 10:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31267#M7436</guid>
      <dc:creator>Doyleuk</dc:creator>
      <dc:date>2009-05-15T10:59:19Z</dc:date>
    </item>
    <item>
      <title>UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31268#M7437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Macro perfoms slow on large datasets with large number of char variables &lt;/P&gt;&lt;P&gt;I modified it &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%MACRO UPCASE_ALL(LIB, DS);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC SQL NOPRINT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT STRIP(NAME)||" = UPCASE( "||STRIP(NAME) || ");" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO :CODE_STR&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEPARATED BY ' '&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DICTIONARY.COLUMNS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE LIBNAME = UPCASE("&amp;amp;LIB")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND MEMNAME = UPCASE("&amp;amp;DS")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND TYPE = 'char';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;amp;DS;&lt;BR /&gt; SET&amp;nbsp; &amp;amp;DS;&lt;BR /&gt;&amp;nbsp; &amp;amp;CODE_STR&lt;BR /&gt; RUN;&lt;/P&gt;&lt;P&gt;%MEND;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;%UPCASE_ALL(WORK,INCD2);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2012 20:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31268#M7437</guid>
      <dc:creator>Privet3711</dc:creator>
      <dc:date>2012-01-13T20:56:56Z</dc:date>
    </item>
    <item>
      <title>UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31269#M7438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need for a macro. Try this model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; have ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;set&lt;/SPAN&gt; sashelp.class ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New; color: #008000;"&gt;* keep _numeric_ ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New; color: #000080;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; want ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;set&lt;/SPAN&gt; have ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;array&lt;/SPAN&gt; charvar&lt;LI&gt; _character_ ;&lt;/LI&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; i = &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;to&lt;/SPAN&gt; dim(charvar) ; &lt;SPAN style="color: #0000ff;"&gt;drop&lt;/SPAN&gt; i ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; charvar(i) = upcase( charvar(i) ) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New; color: #000080;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that if there happen to be no character variables, a WARNING appears. You may want to bulletproof for that situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2012 22:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31269#M7438</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-01-13T22:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31270#M7439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are a couple of tricks to make the code shorter (and in my opinion clearer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To eliminate the need to drop the index variable you can use the special variable _N_.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array _char _character_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do _n_ =1 to dim(_char);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _char(_n_)=upcase(_char(_n_));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or use the DO OVER syntax.&amp;nbsp; This is clearer for this type of problem as the index has no meaning for this array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array _char _character_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over _char ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _char=upcase(_char);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could add and drop a character variable to prevent the warning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length _dummych $1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop _dummych;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array _char _character_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do _n_ =2 to dim(_char);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _char(_n_)=upcase(_char(_n_));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Jan 2012 03:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31270#M7439</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-01-14T03:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31271#M7440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... another possibilty (if you don't mind changing the variable names to uppercase in the process) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* from ... &lt;A href="http://support.sas.com/documentation/cdl/en/nlsref/61893/HTML/default/viewer.htm#a002473805.htm"&gt;http://support.sas.com/documentation/cdl/en/nlsref/61893/HTML/default/viewer.htm#a002473805.htm&lt;/A&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc trantab table=ascii;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;replace 'a' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;save table=upper;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;input name : $10. Gender : $1.&amp;nbsp; CITY : $10. age;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Mike m Albany 25&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Art m Toronto 30&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc cport data=test file='z:\test.cpt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;trantab name=upper;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc cimport data=test_new file='z:\test.cpt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc print data=test_new;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&amp;nbsp;&amp;nbsp;&amp;nbsp; GENDER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CITY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIKE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALBANY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ART&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TORONTO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Jan 2012 16:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31271#M7440</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-01-15T16:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31272#M7441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike, Nice approach and this time I&amp;nbsp; definitely can follow the logic.&amp;nbsp; I thought you might have been referring to you and me in the example data .. until I saw the ages listed &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Jan 2012 19:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31272#M7441</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-15T19:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31273#M7442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike . You do not need to make translate table.&lt;/P&gt;&lt;P&gt;In proc cport ,there is already an option to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;filename tran 'c:\x.dat';
proc cport library=sashelp outtype=upcase file=tran memtype=data;
 select class;
run;
proc cimport infile=tran library=work;run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2012 03:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/31273#M7442</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-01-16T03:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/939048#M83607</link>
      <description>&lt;P&gt;There is a SAS option for this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;option validvarname=upcase;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 09:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/939048#M83607</guid>
      <dc:creator>Tammboy</dc:creator>
      <dc:date>2024-08-13T09:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/942821#M83633</link>
      <description>&lt;P&gt;&lt;STRONG&gt;You can also so this using PROC DATASETS and FORMAT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can use &lt;CODE&gt;PROC DATASETS&lt;/CODE&gt; to modify the dataset without having to explicitly loop through the variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Applying Uppercase Formatting to Character Variables&lt;/P&gt;&lt;P&gt;In this method, you use the &lt;CODE&gt;$upcase.&lt;/CODE&gt; format to ensure that all character variables in your dataset are stored in uppercase format. The &lt;CODE&gt;$upcase.&lt;/CODE&gt; format is predefined in SAS and will automatically convert all character data to uppercase.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc datasets lib=work nolist;
    modify original_dataset;
    format _character_ $upcase.;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 23:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/942821#M83633</guid>
      <dc:creator>Sarath_A_SAS</dc:creator>
      <dc:date>2024-09-05T23:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: UPCASE ALL VARIABLES IN DATASET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/943091#M83636</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/469046"&gt;@Sarath_A_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're replying to a very old discussion here....&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;In this method, you use the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;$upcase.&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;format to ensure that all character variables in your dataset are &lt;STRONG&gt;stored&lt;/STRONG&gt; in uppercase format.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually: Using format $upcase. will DISPLAY/PRINT the characters uppercase but it will not change how they are stored. If you want to change how they are stored you need to rewrite the values using code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all_upper;
  set sashelp.class;
  array cvars {*} _character_;
  do _i=1 to dim(cvars);
    cvars[_i]=upcase(cvars[_i]);
  end;
  drop _i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2024 01:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UPCASE-ALL-VARIABLES-IN-DATASET/m-p/943091#M83636</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-09-09T01:17:27Z</dc:date>
    </item>
  </channel>
</rss>

