<?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 create a prompt to enter a list of values in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475744#M30872</link>
    <description>&lt;P&gt;Exactly what form does the text that your user pastes in take? That will help figure out how to put it into your SQL. Please give an example of exactly what they would paste.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jul 2018 17:27:55 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2018-07-05T17:27:55Z</dc:date>
    <item>
      <title>How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475706#M30868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a prompt where the user can paste great amount of values. I insert the prompt in the where clause on a query builder with an In a list operator but when I run it the prompt only give me the option to enter one value at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to put the prompt in a filter a sort task as seen in code below but this task does not recognize the prompt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET CIF = s1;&lt;BR /&gt;%LET CIF_count = 1;&lt;BR /&gt;PROC SQL NOEXEC;&lt;BR /&gt;SELECT t2.CIF,&lt;BR /&gt;t2.CLIENTE,&lt;BR /&gt;t1.NO_CUENTA,&lt;BR /&gt;t2.CEDULA,&lt;BR /&gt;t2.PASAPORTE,&lt;BR /&gt;t2.RNC,&lt;BR /&gt;t2.SEGMENTO,&lt;BR /&gt;t1.TIPO_CUENTA&lt;BR /&gt;FROM WORK.QUERY_FOR_CUP0_0000 t2&lt;BR /&gt;INNER JOIN WORK.QUERY_FOR_CUP0_0001 t1 ON (t2.CIF = t1.CIF)&lt;BR /&gt;WHERE t1.TIPO_CUENTA IN&lt;BR /&gt;(&lt;BR /&gt;'SOW',&lt;BR /&gt;'IND',&lt;BR /&gt;'JAF',&lt;BR /&gt;'JOF'&lt;BR /&gt;) AND&lt;STRONG&gt; %_eg_WhereParam( t2.CIF, CIF, IN, TYPE=S, IS_EXPLICIT=0 )&lt;/STRONG&gt;&lt;BR /&gt;ORDER BY t2.CLIENTE;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 15:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475706#M30868</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-05T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475744#M30872</link>
      <description>&lt;P&gt;Exactly what form does the text that your user pastes in take? That will help figure out how to put it into your SQL. Please give an example of exactly what they would paste.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 17:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475744#M30872</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-07-05T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475791#M30873</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They would pastes identification value of a client, is character type. This one is an example: 0005164890. Sometimes they would need to pastes up to 700 values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 19:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475791#M30873</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-05T19:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475870#M30883</link>
      <description>&lt;P&gt;What I was trying to ask was the exact format. So, for instance, would it be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0005164890&lt;BR /&gt;0005164917&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0005164890,&lt;BR /&gt;0005164917&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0005164890, 0005164917&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0005164890 0005164917&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 00:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475870#M30883</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-07-06T00:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475907#M30887</link>
      <description>&lt;P&gt;Is the prompt-query added to the sort task properties?&lt;/P&gt;
&lt;P&gt;Check it out by right-click on the sort task, select properties and then queries.&lt;/P&gt;
&lt;P&gt;If the prompt is not added, just add it and hopefully it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 06:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/475907#M30887</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-07-06T06:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476003#M30892</link>
      <description>&lt;P&gt;Hello Fred,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is not such option in the properties of filter and sort task.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 13:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476003#M30892</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-06T13:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476007#M30893</link>
      <description>&lt;P&gt;Hello Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be the first one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;0005164890&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0005164917&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 13:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476007#M30893</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-06T13:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476045#M30895</link>
      <description>&lt;P&gt;So here's what I got working. Set up a prompt, as a text field, option Multi-line text. I named mine "PromptText". When I ran it, I pasted in&lt;/P&gt;
&lt;P&gt;11&lt;BR /&gt;14&lt;BR /&gt;16&lt;/P&gt;
&lt;P&gt;as the text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote this program:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	PromptText = transtrn("&amp;amp;PromptText.", " ", ", ");
	call symput("InClause", strip(PromptText));
run;

proc sql noprint;
	create table Want as
		select * from sashelp.class
			where Age in(&amp;amp;InClause.);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;At some point it seems the carriage returns are converted to spaces. The first program converts spaces to ", ", and loads it back into a macro variable. The second step runs the query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be a little more futzing required, but hopefully this will get you on the 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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 15:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476045#M30895</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-07-06T15:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476050#M30896</link>
      <description>&lt;P&gt;There is no need to put in the commas.&lt;/P&gt;
&lt;P&gt;SAS is very happy to accept spaces as delimiters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let PromptText=13  14;
proc print data=sashelp.class ;
 where age in (&amp;amp;PromptText);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now if the variable you are comparing to is character then you will need to add quotes if the pasted values do not already include them.&amp;nbsp; If you make sure to change multiple spaces to one then using TRANWRD() to change spaces to quoted spaces will do it for you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let PromptText=Alice   Alfred;
%let PromptText=%sysfunc(compbl(&amp;amp;PromptText));
proc print data=sashelp.class ;
where name in (
"%sysfunc(tranwrd(&amp;amp;prompttext,%str( )," "))"
);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 15:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476050#M30896</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-06T15:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476053#M30897</link>
      <description>Thank you TomKari!!</description>
      <pubDate>Fri, 06 Jul 2018 15:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476053#M30897</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-06T15:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476943#M30972</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to run the code I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;28&lt;BR /&gt;29 proc sql;&lt;BR /&gt;30 create table work.test as&lt;BR /&gt;31 select * from WORK.QUERY_FOR_CUP0_0001_0000 t1&lt;BR /&gt;32 where t1.CIF in(&amp;amp;InClause.);&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;NOTE: Line generated by the macro variable "INCLAUSE".&lt;BR /&gt;32 s1&lt;BR /&gt;__&lt;BR /&gt;22&lt;BR /&gt;202&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, (, -, SELECT.&lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I can't paste more than one value at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 21:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/476943#M30972</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-10T21:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/477044#M30977</link>
      <description>&lt;P&gt;First, let's figure out if your program is picking up the macro variable. Put the line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;InClause.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;above the "proc sql;" line, and see if the log contains something reasonable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/477044#M30977</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-07-11T12:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a prompt to enter a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/477200#M30990</link>
      <description>&lt;P&gt;Hello Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is working now, what I forgot was to configure a multiline prompt. But I realized that the form of the value must be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'0000000085',&lt;BR /&gt;'0000000086',&lt;BR /&gt;'0002746556',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to add quotation marks and commas.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-prompt-to-enter-a-list-of-values/m-p/477200#M30990</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2018-07-11T18:49:46Z</dc:date>
    </item>
  </channel>
</rss>

