<?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: UPPERCASE AND LOWERCASE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397103#M95943</link>
    <description>&lt;P&gt;Not entirely sure about your intention, is it value of the variable(see &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s solution), or is it the name of the variable, since you mentioned metadata 'vcolumns'. SAS, in operation, does not care the case of the variables, however, you can still put it out as&amp;nbsp;being shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set sashelp.class(keep=age); /*Age came in as Proper case variable*/
	AGE_UP=age;/*upper case variable name*/
	age_low=age;/*lower case variable name*/
	array _age age:;
	array po proper upper lower;

	do over _age;
	/*the show the position of first lower case in the varialble name*/
		po=anylower(vname(_age));/*you can also use anyupper() for this purpose*/
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Sep 2017 13:14:27 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2017-09-19T13:14:27Z</dc:date>
    <item>
      <title>UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397096#M95938</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am quite new here as SAS user and i need your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any code to identify the variable, if its lowercase or uppercase? Without looking into sashelp.vcolumn?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is, i want to make a list which variable that already uppercase&amp;nbsp;and which one are not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;btw i use SAS enterprise guide&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WPH&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397096#M95938</guid>
      <dc:creator>WPH</dc:creator>
      <dc:date>2017-09-19T12:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397098#M95940</link>
      <description>&lt;P&gt;Perhaps something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Compare the variable to its upcase equivalent and output accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input charvar$;
datalines;
Hello
HELLO
;

data Upcase notUpcase;
	set have;
	if upcase(charvar)=charvar then output Upcase;
	else output notUpcase;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397098#M95940</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-09-19T12:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397103#M95943</link>
      <description>&lt;P&gt;Not entirely sure about your intention, is it value of the variable(see &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s solution), or is it the name of the variable, since you mentioned metadata 'vcolumns'. SAS, in operation, does not care the case of the variables, however, you can still put it out as&amp;nbsp;being shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set sashelp.class(keep=age); /*Age came in as Proper case variable*/
	AGE_UP=age;/*upper case variable name*/
	age_low=age;/*lower case variable name*/
	array _age age:;
	array po proper upper lower;

	do over _age;
	/*the show the position of first lower case in the varialble name*/
		po=anylower(vname(_age));/*you can also use anyupper() for this purpose*/
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Sep 2017 13:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397103#M95943</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2017-09-19T13:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397105#M95944</link>
      <description>Hi Haikuo and Draycut&lt;BR /&gt;&lt;BR /&gt;Thank you for your response.&lt;BR /&gt;&lt;BR /&gt;My intention was the name of the variable. I have created some macro, could you please take a look. What do you think?&lt;BR /&gt;&lt;BR /&gt;%MACRO check_upcase;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE check_01 AS&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM sashelp.vcolumn&lt;BR /&gt;WHERE memname EQ 'ADAE' AND libname EQ 'DERIVED';&lt;BR /&gt;QUIT;&lt;BR /&gt;DATA notupcase;&lt;BR /&gt;set check_01;&lt;BR /&gt;IF upcase(name)NE name THEN OUTPUT notupcase;&lt;BR /&gt;RUN;&lt;BR /&gt;%IF obs. &amp;gt;0 %THEN %DO;&lt;BR /&gt;%PUT %SYSFUNC( CATT(WARNING: Please check the dataset check_upcase. Some variable its not UPCASE. )) ;&lt;BR /&gt;%END;&lt;BR /&gt;%MEND check_upcase;&lt;BR /&gt;%check_upcase;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Sep 2017 13:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397105#M95944</guid>
      <dc:creator>WPH</dc:creator>
      <dc:date>2017-09-19T13:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397115#M95948</link>
      <description>&lt;P&gt;Not sure why you need a macro, but your code is&amp;nbsp;unnecessarily complicated, you can wrap up the following code in a macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.vcolumn;
WHERE memname EQ 'ADAE' AND libname EQ 'DERIVED';
IF upcase(name)NE name 
then put "WARNING: Please check the dataset check_upcase. Some variable its not UPCASE.";&lt;BR /&gt;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Sep 2017 16:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397115#M95948</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2017-09-19T16:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397116#M95949</link>
      <description>&lt;P&gt;Ah ok sorry, did not catch that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 13:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397116#M95949</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-09-19T13:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397123#M95950</link>
      <description>&lt;P&gt;I think something is wrong with this statement&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;%IF obs. &amp;gt;0 %THEN %DO;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is OBS a dataset variable or a macro variable?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 14:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397123#M95950</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-09-19T14:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397164#M95961</link>
      <description>Hi Haikuo,&lt;BR /&gt;&lt;BR /&gt;I try to wrap up your code in the macro, please see&lt;BR /&gt;&lt;BR /&gt;%MACRO check_upcase;&lt;BR /&gt;data _null_;&lt;BR /&gt;set sashelp.vcolumn;&lt;BR /&gt;WHERE memname EQ 'ADAE' AND libname EQ 'DERIVED';&lt;BR /&gt;%IF upcase(name)NE name %then %DO;&lt;BR /&gt;%put %SYSFUNC( CATT( WARNING: Please check the dataset check_upcase Some variable its not UPCASE));&lt;BR /&gt;%END;&lt;BR /&gt;%MEND check_upcase;&lt;BR /&gt;%check_upcase;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Unfortunately come this error message, could you help me please&lt;BR /&gt;&lt;BR /&gt;The SAS System&lt;BR /&gt;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;ERROR: Required operator not found in expression: upcase(name)NE name&lt;BR /&gt;ERROR: The macro CHECK_UPCASE will stop executing.&lt;BR /&gt;39 ;*';*";*/;quit;run;&lt;BR /&gt;____&lt;BR /&gt;180&lt;BR /&gt;&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&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.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Sep 2017 15:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397164#M95961</guid>
      <dc:creator>WPH</dc:creator>
      <dc:date>2017-09-19T15:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: UPPERCASE AND LOWERCASE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397189#M95971</link>
      <description>&lt;P&gt;You are a fresh SAS user, I suggest you progress one step at a time. I would try to learn how to write plain SAS code as the first step, then I will learn how to delivery it (Macro). As a rule of thumb, advoid mixing SAS code and Macro like you did. Here, when I&amp;nbsp;say 'wrap my code', I mean 'wrap my code' as is, not 'modify my code then wrap it' :),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO check_upcase;
data _null_;
set sashelp.vcolumn;
WHERE memname EQ 'ADAE' AND libname EQ 'DERIVED';
IF upcase(name)NE name 
then put "WARNING: Please check the dataset check_upcase. Some variable its not UPCASE.";&lt;BR /&gt;run;
%MEND check_upcase;
%check_upcase;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 16:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPPERCASE-AND-LOWERCASE/m-p/397189#M95971</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2017-09-19T16:53:01Z</dc:date>
    </item>
  </channel>
</rss>

