<?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 incomprehensible message of data: Developing Macro Applications in Advanced Programming</title>
    <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768315#M123</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, could you help me regarding my program which doesn't work well. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this message on my Log which is contradictory:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: BE is an invalid country code&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Valid country codes include&lt;/DIV&gt;&lt;DIV class="sasError"&gt;AT,AU,BE,CA,CH,CI,DE,DK,EG,ES,FI,FR,GB,GR,HR,IE,IL,IN,IT,LT,LU,MZ,NL,NO,NZ,PL,PT,SE,SI,TR,US,YU,ZA&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;103&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;104&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;105 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;115&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;My progrm code is below:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;P&gt;%macro customerlist(ctry)/minoperator;&lt;BR /&gt;%if %SUPERQ(ctry)= %then %do;&lt;BR /&gt;title "Customers from all countries";&lt;BR /&gt;proc sgplot data=mc1.customers noborder;&lt;BR /&gt;vbar Group / filltype=gradient stat=percent;&lt;BR /&gt;yaxis grid display=(noticks noline nolabel);&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;&amp;nbsp; %let ctry=%upcase(&amp;amp;ctry);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;proc sql ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;select distinct Country&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;into :ctrylist separated by ','&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;from mc1.customers;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;%if %SUPERQ(ctry) in %SUPERQ(ctrylist) %then %do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; title "Customers from &amp;amp;ctry";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; proc sgplot data=mc1.customers noborder;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; vbar Group / filltype=gradient stat=percent;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis grid display=(noticks noline nolabel);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;where Country="&amp;amp;ctry";&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%put ERROR: &amp;amp;ctry is an invalid country code;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%put ERROR- Valid country codes include &amp;amp;ctrylist;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend customerlist;&lt;/P&gt;&lt;P&gt;%customerlist(be)&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 14:58:18 GMT</pubDate>
    <dc:creator>CorinneT</dc:creator>
    <dc:date>2021-09-17T14:58:18Z</dc:date>
    <item>
      <title>incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768315#M123</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, could you help me regarding my program which doesn't work well. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this message on my Log which is contradictory:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: BE is an invalid country code&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Valid country codes include&lt;/DIV&gt;&lt;DIV class="sasError"&gt;AT,AU,BE,CA,CH,CI,DE,DK,EG,ES,FI,FR,GB,GR,HR,IE,IL,IN,IT,LT,LU,MZ,NL,NO,NZ,PL,PT,SE,SI,TR,US,YU,ZA&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;103&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;104&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;105 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;115&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;My progrm code is below:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;P&gt;%macro customerlist(ctry)/minoperator;&lt;BR /&gt;%if %SUPERQ(ctry)= %then %do;&lt;BR /&gt;title "Customers from all countries";&lt;BR /&gt;proc sgplot data=mc1.customers noborder;&lt;BR /&gt;vbar Group / filltype=gradient stat=percent;&lt;BR /&gt;yaxis grid display=(noticks noline nolabel);&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;&amp;nbsp; %let ctry=%upcase(&amp;amp;ctry);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;proc sql ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;select distinct Country&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;into :ctrylist separated by ','&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;from mc1.customers;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;%if %SUPERQ(ctry) in %SUPERQ(ctrylist) %then %do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; title "Customers from &amp;amp;ctry";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; proc sgplot data=mc1.customers noborder;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; vbar Group / filltype=gradient stat=percent;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis grid display=(noticks noline nolabel);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;where Country="&amp;amp;ctry";&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%put ERROR: &amp;amp;ctry is an invalid country code;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%put ERROR- Valid country codes include &amp;amp;ctrylist;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend customerlist;&lt;/P&gt;&lt;P&gt;%customerlist(be)&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 14:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768315#M123</guid>
      <dc:creator>CorinneT</dc:creator>
      <dc:date>2021-09-17T14:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768372#M124</link>
      <description>&lt;P&gt;Please provide us the entire LOG for this macro (and in the future, always provide the entire LOG for the code in question, always, always, always). First turn on these options before you run the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint mlogic symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then copy the log (all of it, every single line in the log from this macro, do no chop anything out of the log) and &lt;FONT color="#FF0000"&gt;paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon&lt;/FONT&gt; — &lt;STRONG&gt;DO NOT SKIP THE INSTRUCTIONS IN &lt;FONT color="#FF0000"&gt;RED&lt;/FONT&gt;&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 21:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768372#M124</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-17T21:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768389#M125</link>
      <description>&lt;P&gt;Syle note: Generally Error checks, like in the list go at the beginning of a macro, not after generating a bunch of procedure steps that could fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see option minnoperator. How about Mindelimiter? Did you set that to comma?&lt;/P&gt;
&lt;P&gt;Note: may want a different delimiter than comma as comma is used is many places in macro code and can easily lead to other hard to trace issues like "too many parameter" errors.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 22:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768389#M125</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-17T22:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768390#M126</link>
      <description>&lt;P&gt;Your list of countries in CTRYLIST is delimited by commas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use the IN operator in the macro language, it's probably a good practice to specify the delimiter in the macro definition, i.e.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%macro customerlist(ctry)/minoperator mindelimiter=',' ;&lt;/PRE&gt;
&lt;P&gt;If you don't specify the delimiter on the macro definition, you'll be at the mercy of whatever value is set for mindelimiter when the macro is called.&amp;nbsp; The default is a space, which would explain why your macro isn't working as you had hoped.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 22:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768390#M126</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-09-17T22:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768396#M127</link>
      <description>&lt;P&gt;You added the MINOPERATOR option to make sure the macro supports the IN operator, but you did not tell it what character to use a the delimiter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you don't really need to use the IN operator in your macro code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you already had to run some SAS code just test the country code with the SAS code. SAS code is much easier to debug than macro code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro customerlist(ctry);
%local ctrylist found ;
%if 0=%length(ctry) %then %let ctry=ALL;
%else ctry=%qupcase(&amp;amp;ctry);

%if &amp;amp;ctry = ALL %then %let found=1;
%else %do ;
  proc sql noprint;
    select distinct country
         , max(upcase(country)="&amp;amp;ctry")
      into :ctrylist separated by ' '
         , :found 
    ;
  quit;
%end;

%if not &amp;amp;found %then do;
   %put ERROR: &amp;amp;ctry is an invalid country code;
   %put ERROR- Valid country codes include &amp;amp;ctrylist;
%end;
%else %do;

TITLE "Customers from country: &amp;amp;ctry";

  proc sgplot data=mc1.customers noborder;
    vbar Group / filltype=gradient stat=percent;
    yaxis grid display=(noticks noline nolabel);
  %if &amp;amp;ctry ne ALL %then %do;
    where Country="&amp;amp;ctry";
  %end;
  run;
%end;
%mend customerlist;

%customerlist(be)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 23:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768396#M127</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-17T23:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768414#M128</link>
      <description>Thank you so much, Quentin. It's the solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;with:&lt;BR /&gt;" mindelimiter=','"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Sep 2021 09:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768414#M128</guid>
      <dc:creator>CorinneT</dc:creator>
      <dc:date>2021-09-18T09:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: incomprehensible message of data: Developing Macro Applications</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768415#M129</link>
      <description>Yes, it's a good tip regarding the "options mprinen ....."&lt;BR /&gt;I have to add it to monitor my macro program.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Sep 2021 09:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/incomprehensible-message-of-data-Developing-Macro-Applications/m-p/768415#M129</guid>
      <dc:creator>CorinneT</dc:creator>
      <dc:date>2021-09-18T09:46:24Z</dc:date>
    </item>
  </channel>
</rss>

