<?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 correctly use multi-value prompt with a 'Contains' filter? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596480#M15954</link>
    <description>&lt;P&gt;I've been poking around a bit with this multi-value case and it appears that the ootb EG macro&amp;nbsp;%_eg_WhereParam() doesn't cover this case for a contains operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The prompt type you're using generates actually a set of separate macros. Below an example for a prompt with name MyPrompt:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* macro variables created for MyPrompt with 3 values selected */
%let MYPROMPT0 =3;
%let MYPROMPT1 =Plumber;
%let MYPROMPT2 =Electrician;
%let MYPROMPT3 =Carpenter;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you select operator &lt;EM&gt;in a list&lt;/EM&gt; then macro&amp;nbsp;%_eg_WhereParam() creates valid syntax. But it doesn't work for operator &lt;EM&gt;contains&lt;/EM&gt; and I couldn't figure out "a hack" to get around this using the query builder.&lt;/P&gt;
&lt;P&gt;You could of course write your own SAS code and then implement some macro logic which builds correct syntax from such a prompt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if one should call this a defect or not. May be consider raising a SAS Tech Support track for this one.&lt;/P&gt;
&lt;P&gt;What macro&amp;nbsp;%_eg_WhereParam() does is to create a comma delimited list as required for an IN operator. It would need to create a list of separate OR conditions per prompt values for a contains operator to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2019 11:31:18 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-10-15T11:31:18Z</dc:date>
    <item>
      <title>How to correctly use multi-value prompt with a 'Contains' filter?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596290#M15922</link>
      <description>&lt;P&gt;I have a multi-valued prompt, with 4 drop down options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Job title&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Plumber&lt;/P&gt;&lt;P&gt;2) Electrician&lt;/P&gt;&lt;P&gt;3) Carpenter&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) Plaster&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use this prompt with a 'Contains'&amp;nbsp;filter in a query builder, I constantly get a syntax error and I cant figure out why.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will work with a 'In a list' filter, but I don't have high quality data and can't guarantee that the prompt values will match exactly, hence the need for a 'Contains' filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to use the method I'm looking at?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A final point, does anyone know why filters and prompts require the "Match Case" option to be enabled? Again, the query builder throws a syntax error if it is unticked.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596290#M15922</guid>
      <dc:creator>sass_numero_uno</dc:creator>
      <dc:date>2019-10-14T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to correctly use multi-value prompt with a 'Contains' filter?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596417#M15941</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Set it up as shown below as else EG will wrap single quotes around the prompt (the macro variable) and it doesn't get resolved.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 473px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33138i4B9152BD3454B93E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 03:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596417#M15941</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-15T03:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to correctly use multi-value prompt with a 'Contains' filter?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596448#M15948</link>
      <description>&lt;P&gt;That is exactly how my 'Contains' filter looks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the node, it runs correctly and the prompt window appears fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I select only 1 variable, such as "Plumber" it runs fine and selects those with a plumber job, and outputs the data fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its only when I select more than 1 variable in the prompt, e.g. "Plumber" and "Electrician" from the prompt's available values is when I get the syntax error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the prompt not able to separate multiple variables to search for the "Contains" operator?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 08:28:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596448#M15948</guid>
      <dc:creator>sass_numero_uno</dc:creator>
      <dc:date>2019-10-15T08:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to correctly use multi-value prompt with a 'Contains' filter?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596480#M15954</link>
      <description>&lt;P&gt;I've been poking around a bit with this multi-value case and it appears that the ootb EG macro&amp;nbsp;%_eg_WhereParam() doesn't cover this case for a contains operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The prompt type you're using generates actually a set of separate macros. Below an example for a prompt with name MyPrompt:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* macro variables created for MyPrompt with 3 values selected */
%let MYPROMPT0 =3;
%let MYPROMPT1 =Plumber;
%let MYPROMPT2 =Electrician;
%let MYPROMPT3 =Carpenter;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you select operator &lt;EM&gt;in a list&lt;/EM&gt; then macro&amp;nbsp;%_eg_WhereParam() creates valid syntax. But it doesn't work for operator &lt;EM&gt;contains&lt;/EM&gt; and I couldn't figure out "a hack" to get around this using the query builder.&lt;/P&gt;
&lt;P&gt;You could of course write your own SAS code and then implement some macro logic which builds correct syntax from such a prompt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if one should call this a defect or not. May be consider raising a SAS Tech Support track for this one.&lt;/P&gt;
&lt;P&gt;What macro&amp;nbsp;%_eg_WhereParam() does is to create a comma delimited list as required for an IN operator. It would need to create a list of separate OR conditions per prompt values for a contains operator to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 11:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-correctly-use-multi-value-prompt-with-a-Contains-filter/m-p/596480#M15954</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-15T11:31:18Z</dc:date>
    </item>
  </channel>
</rss>

