<?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: How to use BASECHAR and UPCASE in a Macro Variable %LET? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489774#M31612</link>
    <description>&lt;P&gt;Answering the question in your subject line and ignoring the gibberish in your question content.&lt;/P&gt;
&lt;P&gt;Here is an example using one of the values in the examples in the documentation.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let original=Mühlenfließ ;
%let changed=%sysfunc(basechar(%upcase(&amp;amp;original)));
%put &amp;amp;=original &amp;amp;=changed ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;ORIGINAL=Mühlenfließ CHANGED=MUHLENFLIEß&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Aug 2018 21:09:44 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-08-24T21:09:44Z</dc:date>
    <item>
      <title>How to use BASECHAR and UPCASE in a Macro Variable %LET?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489747#M31610</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create this simple list you can find below.&lt;/P&gt;&lt;P&gt;I want the PROC SQL to correct the lower case and also to correct if the variable is with special caracteres ç or í ê î ô&amp;nbsp; etc...&lt;/P&gt;&lt;P&gt;Right now if i'm typing tp_subsidio the code is running fine (so the UPCASE is working)&lt;/P&gt;&lt;P&gt;But if i write tp_subsÍdio the BASECHAR is not working, as you can also see from the log below.&lt;/P&gt;&lt;P&gt;How do I solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET VARIABLE = tp_subsÍdio;&lt;BR /&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;SELECT DISTINCT BASECHAR(UPCASE(&amp;amp;VARIABLE)) AS LIST_&amp;amp;VARIABLE&lt;BR /&gt;FROM BS_PORT.BS_PORT_&amp;amp;EX.;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*** log ***&lt;/P&gt;&lt;P&gt;25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET VARIABLE = tp_subsídio;&lt;BR /&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC SQL;&lt;BR /&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT DISTINCT BASECHAR(UPCASE(&amp;amp;VARIABLE)) AS LIST_&amp;amp;VARIABLE&lt;BR /&gt;SYMBOLGEN:&amp;nbsp; Macro variable VARIABLE resolves to tp_subsídio&lt;BR /&gt;SYMBOLGEN:&amp;nbsp; Macro variable VARIABLE resolves to tp_subsídio&lt;BR /&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM BS_PORT.BS_PORT_&amp;amp;EX.;&lt;BR /&gt;SYMBOLGEN:&amp;nbsp; Macro variable EX resolves to 201806&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: 'tp_subsídio'n.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 20:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489747#M31610</guid>
      <dc:creator>dllfrancelino</dc:creator>
      <dc:date>2018-08-24T20:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BASECHAR and UPCASE in a Macro Variable %LET?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489766#M31611</link>
      <description>&lt;P&gt;First of all, you need to know that macros really just perform text substitution, the value of the macro variable is used in place of the macro variable when the code is run. And furthermore, when this text substitution happens when you run the code, LEGAL VALID SAS code must be created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, when you run your code, this line is created (text substition is shown in &lt;FONT color="#FF0000"&gt;red&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SELECT DISTINCT BASECHAR(UPCASE(&lt;FONT color="#FF0000"&gt;tp_subsídio&lt;/FONT&gt;)) AS LIST_&lt;FONT color="#FF0000"&gt;tp_subsídio&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is not valid SAS code because, as explained in the error message,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;The following columns were not found in the contributing tables: 'tp_subsídio'n&lt;/PRE&gt;
&lt;P&gt;There is no such variable, so UPCASE can't work on a variable that doesn't exist. You need to provide a variable name that actually exists in the data set.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 20:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489766#M31611</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-24T20:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BASECHAR and UPCASE in a Macro Variable %LET?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489774#M31612</link>
      <description>&lt;P&gt;Answering the question in your subject line and ignoring the gibberish in your question content.&lt;/P&gt;
&lt;P&gt;Here is an example using one of the values in the examples in the documentation.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let original=Mühlenfließ ;
%let changed=%sysfunc(basechar(%upcase(&amp;amp;original)));
%put &amp;amp;=original &amp;amp;=changed ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;ORIGINAL=Mühlenfließ CHANGED=MUHLENFLIEß&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Aug 2018 21:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-BASECHAR-and-UPCASE-in-a-Macro-Variable-LET/m-p/489774#M31612</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-24T21:09:44Z</dc:date>
    </item>
  </channel>
</rss>

