<?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: making a macro variable/parameter all uppercase in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40637#M8295</link>
    <description>%UPCASE macro function &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514upcase.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514upcase.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
or %SYSFUNC to invoke the datastep UPCASE function&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514sysfunc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514sysfunc.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Fri, 25 Jun 2010 14:31:05 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-06-25T14:31:05Z</dc:date>
    <item>
      <title>making a macro variable/parameter all uppercase</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40636#M8294</link>
      <description>I have recently been fairly frustrated by SAS's insistence on using string functions only on dataset variables, and not macro variables.&lt;BR /&gt;
&lt;BR /&gt;
I just wrote a macro that has a parameter which allows the user to name a set of variables to be excluded from the macro's analysis:&lt;BR /&gt;
&lt;BR /&gt;
droplist=("age1y1_S","age1y2_S","age1y3_S","age2y1_S","age2y2_S","age2y3_S")&lt;BR /&gt;
&lt;BR /&gt;
This parameter is called later in an sql where clause:&lt;BR /&gt;
&lt;BR /&gt;
	proc sql;&lt;BR /&gt;
	create table noequal&amp;amp;name as&lt;BR /&gt;
	select * from noequal&amp;amp;name.1&lt;BR /&gt;
	where Variable_Name not in &amp;amp;droplist;&lt;BR /&gt;
&lt;BR /&gt;
This works fine, but I would like to change the program so that this comparison is not case sensitive.  Unfortunately, SAS does not allow me to use upcase() on a macro variable, and my attempts to force the variable into a dataset have been unsuccessful due to its required punctuation and length.  &lt;BR /&gt;
&lt;BR /&gt;
Does anyone know how to possibly fix this problem?</description>
      <pubDate>Fri, 25 Jun 2010 13:47:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40636#M8294</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-25T13:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: making a macro variable/parameter all uppercase</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40637#M8295</link>
      <description>%UPCASE macro function &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514upcase.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514upcase.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
or %SYSFUNC to invoke the datastep UPCASE function&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514sysfunc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/z3514sysfunc.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 25 Jun 2010 14:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40637#M8295</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-25T14:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: making a macro variable/parameter all uppercase</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40638#M8296</link>
      <description>Zantan&lt;BR /&gt;
in addition to the (always) sensible suggestions from Cynthia,&lt;BR /&gt;
you can also invoke the &lt;B&gt;base SAS function COMPARE()&lt;/B&gt; within %sysfunc(). &lt;BR /&gt;
The benefit of compare() is that it has a parameters to indicate options like:&lt;BR /&gt;
1 you wish it to be case insensitive, &lt;BR /&gt;
2 ignore leading blanks&lt;BR /&gt;
3 compare over the length of the shorter of the two strings, rather than the default longer&lt;BR /&gt;
4 remove quotes from name-literals&lt;BR /&gt;
&lt;BR /&gt;
and it will return the position within the strings of the first difference.&lt;BR /&gt;
&lt;BR /&gt;
a better description than mine can be found in the documentation on the SAS web site at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a002206130.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a002206130.htm&lt;/A&gt; .&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
so be frustrated more by our difficulty in finding appropriate search terms to find the solution to our problem  - often our expectations are wrong because more issues than we anticipate have frustrated a simple search.&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 25 Jun 2010 15:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-a-macro-variable-parameter-all-uppercase/m-p/40638#M8296</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-06-25T15:10:31Z</dc:date>
    </item>
  </channel>
</rss>

