<?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: prompt containing a list of strings to filter while using a where condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483404#M31342</link>
    <description>&lt;P&gt;A prompt (and macro) is really not the place to be asking a user to input 600 items.&amp;nbsp; There will end up being mistakes in it.&amp;nbsp; Get your users to provide a CSV file with the relevant paramters, then your prompt can be used to enter that filename.&amp;nbsp; Then your program loads the CSV and filters based on the CSV:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as
  select * 
  from   have
  where xyz not in (select xyz from csv_dataset);
quit;&lt;/PRE&gt;
&lt;P&gt;If I was the user and was told to type in 600 paratmers I wouldn't be using it.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 14:18:05 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-08-02T14:18:05Z</dc:date>
    <item>
      <title>prompt containing a list of strings to filter while using a where condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483392#M31340</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm using SAS EG version 7.1&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;need to create a prompt where the user can input&amp;nbsp;around 600 string values that would be used then in a where condition to filter a table.I can not ask the user to select those values from a list because it would be really inconvenient finding those 600 in a list containing millions of records. The user&amp;nbsp;has&amp;nbsp;a list of these string values and the idea is that they are able to copy paste those in the prompt window. The Prompt would be used in a Stored Procedure that will be running from SAS VA.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is one example&amp;nbsp;that represents what I need to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let list_ID="A","B";
data raw;
input id $ vis a b c d e;
cards;
A 1 1 6 7 8 9
A 2 . 2 3 4 8
A 3 2 3 . . 5
B 1 4 5 . 5 .
B 3 7 5 . . .
B 4 6 7 3 5 3
C 2 9 4 5 7 9
C 3 . . . . .
C 4 7 . . . .
D 1 9 3 9 4 8
D 2 7 . . . .
D 3 . 6 . . 4
E 1 6 5 7 4 6
E 2 . 2 4 . 6
E 3 8 . 5 5 .
E 4 . 8 6 5 4
;
run;
data select;
	set raw;
	where id in (&amp;amp;List_ID.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, when I comment out the %let List_ID and try to use a prompt with the following configuration (see first picture) and input "A","B"&amp;nbsp; (see second picture) I get this error:&lt;/P&gt;&lt;P&gt;ERROR: Syntax error while parsing WHERE clause.&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant,&lt;BR /&gt;a missing value, -.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="prompt.PNG" style="width: 513px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22174iB7B441940644906F/image-size/large?v=v2&amp;amp;px=999" role="button" title="prompt.PNG" alt="prompt.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="prompt2.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22175iCDE20B2258D49E47/image-size/large?v=v2&amp;amp;px=999" role="button" title="prompt2.PNG" alt="prompt2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does someone know how to create such functionality with a prompt??&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483392#M31340</guid>
      <dc:creator>EBB</dc:creator>
      <dc:date>2018-08-02T14:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: prompt containing a list of strings to filter while using a where condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483404#M31342</link>
      <description>&lt;P&gt;A prompt (and macro) is really not the place to be asking a user to input 600 items.&amp;nbsp; There will end up being mistakes in it.&amp;nbsp; Get your users to provide a CSV file with the relevant paramters, then your prompt can be used to enter that filename.&amp;nbsp; Then your program loads the CSV and filters based on the CSV:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as
  select * 
  from   have
  where xyz not in (select xyz from csv_dataset);
quit;&lt;/PRE&gt;
&lt;P&gt;If I was the user and was told to type in 600 paratmers I wouldn't be using it.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483404#M31342</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-02T14:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: prompt containing a list of strings to filter while using a where condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483431#M31345</link>
      <description>&lt;P&gt;This may help get you on your way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/477044#M30977" target="_self"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/477044#M30977&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483431#M31345</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-08-02T14:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: prompt containing a list of strings to filter while using a where condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483686#M31357</link>
      <description>&lt;P&gt;Thanks! I read&amp;nbsp;it and what is working for me is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- A multitext promp. The user should copy paste the list of strings in one line without "" and only with a space in between every string. Example: String1 String2 String3&lt;/P&gt;&lt;P&gt;2-The following let statement to process the content of the prompt&lt;/P&gt;&lt;P&gt;%let PromptText=%sysfunc(compbl(&amp;amp;PromptText));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3-And the following where condition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where barcode in (&lt;BR /&gt;"%sysfunc(tranwrd(&amp;amp;prompttext,%str( )," "))"&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 06:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/prompt-containing-a-list-of-strings-to-filter-while-using-a/m-p/483686#M31357</guid>
      <dc:creator>EBB</dc:creator>
      <dc:date>2018-08-03T06:26:21Z</dc:date>
    </item>
  </channel>
</rss>

