<?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 option minoperator in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619176#M181733</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when running this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test(bla=);

options minoperator mindelimiter=',';

%PUT %lowcase(&amp;amp;bla);
%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in year,month);

options nominoperator mindelimiter=%STR(' ');

%mend;
%test(bla=year);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am expecting to get the value "1" in case bla equals "year" or "month";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is unfortunately not the case. What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to validate the macro parameter values which are set by the user....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;FK&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 14:57:45 GMT</pubDate>
    <dc:creator>FK1</dc:creator>
    <dc:date>2020-01-22T14:57:45Z</dc:date>
    <item>
      <title>option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619176#M181733</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when running this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test(bla=);

options minoperator mindelimiter=',';

%PUT %lowcase(&amp;amp;bla);
%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in year,month);

options nominoperator mindelimiter=%STR(' ');

%mend;
%test(bla=year);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am expecting to get the value "1" in case bla equals "year" or "month";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is unfortunately not the case. What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to validate the macro parameter values which are set by the user....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;FK&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 14:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619176#M181733</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2020-01-22T14:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619178#M181735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114220"&gt;@FK1&lt;/a&gt;&amp;nbsp; You are missing a parenthesis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Correction&lt;/P&gt;
&lt;P&gt;%MACRO test(bla=);&lt;/P&gt;
&lt;P&gt;options minoperator mindelimiter=',';&lt;/P&gt;
&lt;P&gt;%PUT %lowcase(&amp;amp;bla);&lt;BR /&gt;%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in&lt;STRONG&gt; (year,month));&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;options nominoperator mindelimiter=%STR(' ');&lt;/P&gt;
&lt;P&gt;%mend;&lt;BR /&gt;%test(bla=year)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LOG:&lt;/P&gt;
&lt;P&gt;2686 options minoperator mindelimiter=',';&lt;BR /&gt;2687&lt;BR /&gt;2688 %PUT %lowcase(&amp;amp;bla);&lt;BR /&gt;2689 %PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in (year,month));&lt;BR /&gt;2690&lt;BR /&gt;2691 options nominoperator mindelimiter=%STR(' ');&lt;BR /&gt;2692&lt;BR /&gt;2693 %mend;&lt;BR /&gt;2694 %test(bla=year)&lt;BR /&gt;year&lt;BR /&gt;Evaluation value = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619178#M181735</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-22T15:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619179#M181736</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;: okay, it seems, we need parenthesis. I am confused, though, as in the SAS documentation, it is not written that you have to use parenthesis:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0vc5y2nyi55dvn1agla9j658kwh.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0vc5y2nyi55dvn1agla9j658kwh.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option minoperator;

%put %eval(a in d,e,f,a,b,c); /* should print 0 */
%put %eval(a in d e f a b c); /* should print 1 */

option mindelimiter=',';

%put %eval(a in d,e,f,a,b,c); /* should print 1 */
%put %eval(a in d e f a b c); /* should print 0 */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619179#M181736</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2020-01-22T15:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619184#M181737</link>
      <description>&lt;P&gt;Oh I didn't look at the documentation. The standard IN operator across RDBMS languages will require the list to be within parenthesis. Feel free to report to SAS to correct the documentation&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619184#M181737</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-22T15:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619187#M181738</link>
      <description>&lt;P&gt;You don't need parentheses when using the IN operator in macro logic, but if you use them they need to be balanced.&lt;/P&gt;
&lt;P&gt;So if you have a closing parenthesis without an opening one then the extra one becomes part of the value returned.&lt;/P&gt;
&lt;PRE&gt;2106  options minoperator mindelimiter=' ';
2107  %put %eval( y in x y );
1
2108  %put %eval( y in (x y));
1
2109  %put %eval( y in x y));
1)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619187#M181738</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-22T15:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619188#M181739</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114220"&gt;@FK1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One side note.&lt;/P&gt;&lt;P&gt;Why not to use %macro statement options to have the use of the operator macro-specific?&lt;/P&gt;&lt;P&gt;Like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test(bla=) / minoperator mindelimiter=',';

%PUT %lowcase(&amp;amp;bla);
%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in year,month);

%mend;
%test(bla=year);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619188#M181739</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-01-22T15:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619189#M181740</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;: thank's for the side note. I was thinking about this as well.... But same question here:&lt;BR /&gt;Are the parenthesis needed or not?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test(bla=) / minoperator mindelimiter=',';

%PUT %lowcase(&amp;amp;bla);
%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in &lt;STRONG&gt;(year,month)&lt;/STRONG&gt;);

%mend;
%test(bla=year);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:34:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619189#M181740</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2020-01-22T15:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619190#M181741</link>
      <description>&lt;P&gt;From my log, without parenthesis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;3595  %MACRO test(bla=) / minoperator mindelimiter=',';
3596
3597  %PUT %lowcase(&amp;amp;bla);
3598  %PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in year,month);
3599
3600  %mend;
3601  %test(bla=year);
year
Evaluation value = 1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But, as a good programming practice improving readability, I would use: x in (...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 15:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619190#M181741</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-01-22T15:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: option minoperator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619218#M181749</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114220"&gt;@FK1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;: thank's for the side note. I was thinking about this as well.... But same question here:&lt;BR /&gt;Are the parenthesis needed or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test(bla=) / minoperator mindelimiter=',';

%PUT %lowcase(&amp;amp;bla);
%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in &lt;STRONG&gt;(year,month)&lt;/STRONG&gt;);

%mend;
%test(bla=year);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You might consider what happens to readability when you start passing the values that are needed in the IN as macro variables such as&lt;/P&gt;
&lt;PRE&gt;%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in (&amp;amp;yearparm. , &amp;amp;monthparm. )); &lt;/PRE&gt;
&lt;P&gt;Since Yearparm and Monthparm could resolve to almost anything the ( ) around both is quite helpful in letting you see that both are intended as being evaluated with IN. if the code looks like:&lt;/P&gt;
&lt;PRE&gt;%PUT Evaluation value = %eval(%CMPRES(%lowcase(&amp;amp;bla)) in &amp;amp;yearparm. , &amp;amp;monthparm. );&lt;/PRE&gt;
&lt;P&gt;it is not quite as obvious. And the parentheses may help diagnose issues&amp;nbsp;when you pass a complex constructed macro value that blows up the IN operator.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 16:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/option-minoperator/m-p/619218#M181749</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-22T16:37:19Z</dc:date>
    </item>
  </channel>
</rss>

