<?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 Process  multiple prompt values generated from SAS stored process. in Developers</title>
    <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453474#M5659</link>
    <description>&lt;P&gt;See a simple example for building an in-list in SQL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let namecount=3;
%let name1=Alfred;
%let name2=Joyce;
%let name3=Robert;

%macro select_from_prompt;
proc sql;
create table want as
select * from sashelp.class
where name in (
%do i = 1 %to &amp;amp;namecount;
  %if &amp;amp;i &amp;gt; 1 %then ,;
  "&amp;amp;&amp;amp;name&amp;amp;i"
%end;
);
quit;
%mend;
%select_from_prompt
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Apr 2018 09:05:40 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-04-12T09:05:40Z</dc:date>
    <item>
      <title>How to Process  multiple prompt values generated from SAS stored process.</title>
      <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453465#M5655</link>
      <description>&lt;P&gt;Hello guys.&lt;BR /&gt;I am working on sas Stored process.&lt;BR /&gt;where i need to process multiple values from single prompt.&lt;BR /&gt;For example,&lt;BR /&gt;prompt name = Brand.&lt;BR /&gt;after selecting multiple values (for now assume 4 values)it auto creates variables &amp;amp;Brand_count, &amp;amp;Brand1,&amp;amp;Brand2,&amp;amp;Brand3,&amp;amp;Brand4.&lt;BR /&gt;so to use these prompt values I implement these prompts (&amp;amp;Brand1,&amp;amp;Brand2,&amp;amp;Brand3,&amp;amp;Brand4) in code.&lt;BR /&gt;The code runs nicely if I give exactly 4 values,&lt;BR /&gt;but after passing values more or less than 4 (let's say 3 or 5 values)&lt;BR /&gt;then it gives error.&lt;BR /&gt;If someone facing the same issue or have solution .please help me.&lt;/P&gt;&lt;P&gt;i am working on SAS enterprise guide 7.1&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 07:54:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453465#M5655</guid>
      <dc:creator>Sujeet</dc:creator>
      <dc:date>2018-04-12T07:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Process  multiple prompt values generated from SAS stored process.</title>
      <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453466#M5656</link>
      <description>&lt;P&gt;It is difficult to guess what was the programmer intention.&lt;/P&gt;
&lt;P&gt;As the prgram is stored, I suspect if you have the source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the program requires 4 values. try enter '*' as dummy value.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 08:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453466#M5656</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-12T08:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Process  multiple prompt values generated from SAS stored process.</title>
      <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453472#M5657</link>
      <description>&lt;P&gt;I guess you need to do everything in a loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i = 1 %to &amp;amp;brandcount;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and use indirect addressing like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;amp;&amp;amp;brand&amp;amp;i&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But that's all guesswork without seeing the code.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 08:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453472#M5657</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-12T08:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to Process  multiple prompt values generated from SAS stored process.</title>
      <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453473#M5658</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi ,&amp;nbsp;Shmuel,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried dummy values. but only first value from multiple values is accepted while execution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also tried to use &lt;STRONG&gt;&lt;EM&gt;IF ELSE&lt;/EM&gt;&lt;/STRONG&gt; but it does not work.&lt;/P&gt;&lt;PRE&gt;%if &amp;amp;BRAND_COUNT=2 %then 
                            "&amp;amp;brand2";
             %else %do i=1 %to &amp;amp;BRAND_COUNT;
                         "&amp;amp;&amp;amp;brand&amp;amp;i"
             %end; 
               
    quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 08:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453473#M5658</guid>
      <dc:creator>Sujeet</dc:creator>
      <dc:date>2018-04-12T08:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to Process  multiple prompt values generated from SAS stored process.</title>
      <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453474#M5659</link>
      <description>&lt;P&gt;See a simple example for building an in-list in SQL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let namecount=3;
%let name1=Alfred;
%let name2=Joyce;
%let name3=Robert;

%macro select_from_prompt;
proc sql;
create table want as
select * from sashelp.class
where name in (
%do i = 1 %to &amp;amp;namecount;
  %if &amp;amp;i &amp;gt; 1 %then ,;
  "&amp;amp;&amp;amp;name&amp;amp;i"
%end;
);
quit;
%mend;
%select_from_prompt
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 09:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453474#M5659</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-12T09:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Process  multiple prompt values generated from SAS stored process.</title>
      <link>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453481#M5660</link>
      <description>&lt;P&gt;Hi Kurt ,&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;you are right .&amp;nbsp;Looping the values is the only way i can see now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;your example is very useful.&lt;/P&gt;&lt;P&gt;now i am experimenting with your example .&lt;/P&gt;&lt;P&gt;let's see if it works&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 10:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-Process-multiple-prompt-values-generated-from-SAS-stored/m-p/453481#M5660</guid>
      <dc:creator>Sujeet</dc:creator>
      <dc:date>2018-04-12T10:18:05Z</dc:date>
    </item>
  </channel>
</rss>

