<?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 Create a select stamenet from multiple selection input field from a Stored Process in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Create-a-select-stamenet-from-multiple-selection-input-field/m-p/398451#M5523</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm on SAS 9.4M2&lt;/P&gt;
&lt;P&gt;I have a Stored Process that has three Inputs and one of them is a dynamic list from which the user can choose multiple inputs. What I want to do is take these multiple inputs and use them&amp;nbsp;in a&amp;nbsp;select statement for a proc sql later in the programm. The input variable as the name var.&lt;/P&gt;
&lt;P&gt;My thought was to concatenate the input arguments with a.&amp;amp;var1, a.&amp;amp;var2, .... I tried doing this like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i = 1 %to &amp;amp;var0;
            %let newvar1 = var&amp;amp;i;
           %let var = "&amp;amp;var, a.&amp;amp;&amp;amp;newvar1";
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I try to append the current value var with the next value until there are no more values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The do-loop executes correct but the second let-statement doesn't work as intended. Can somebody please point me in the right direction of what I'm doing wrong!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2017 07:29:09 GMT</pubDate>
    <dc:creator>Criptic</dc:creator>
    <dc:date>2017-09-25T07:29:09Z</dc:date>
    <item>
      <title>Create a select stamenet from multiple selection input field from a Stored Process</title>
      <link>https://communities.sas.com/t5/Developers/Create-a-select-stamenet-from-multiple-selection-input-field/m-p/398451#M5523</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm on SAS 9.4M2&lt;/P&gt;
&lt;P&gt;I have a Stored Process that has three Inputs and one of them is a dynamic list from which the user can choose multiple inputs. What I want to do is take these multiple inputs and use them&amp;nbsp;in a&amp;nbsp;select statement for a proc sql later in the programm. The input variable as the name var.&lt;/P&gt;
&lt;P&gt;My thought was to concatenate the input arguments with a.&amp;amp;var1, a.&amp;amp;var2, .... I tried doing this like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i = 1 %to &amp;amp;var0;
            %let newvar1 = var&amp;amp;i;
           %let var = "&amp;amp;var, a.&amp;amp;&amp;amp;newvar1";
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I try to append the current value var with the next value until there are no more values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The do-loop executes correct but the second let-statement doesn't work as intended. Can somebody please point me in the right direction of what I'm doing wrong!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 07:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Create-a-select-stamenet-from-multiple-selection-input-field/m-p/398451#M5523</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2017-09-25T07:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a select stamenet from multiple selection input field from a Stored Process</title>
      <link>https://communities.sas.com/t5/Developers/Create-a-select-stamenet-from-multiple-selection-input-field/m-p/398459#M5524</link>
      <description>&lt;P&gt;So I did some further digging in some SAS notes and have now found a solution that works fine for me and I'm posting it here for somebody with a similar problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var = a.&amp;amp;var1;
%do I = 2 %to &amp;amp;var0;
        data _null_;
	    length building $500.;
	    building = trim(catt("&amp;amp;var", ", a.&amp;amp;", "var", &amp;amp;I));
            call symput('var', building);
        run;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm looping over the data step and use the data step to the work with the string inside of the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output looks like this: a.value1, a.value2, .....&lt;/P&gt;
&lt;P&gt;The first let statement is necassry to append the string correctly.&amp;nbsp; The trim function is not necassry, but I always like including it when working with strings.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 08:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Create-a-select-stamenet-from-multiple-selection-input-field/m-p/398459#M5524</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2017-09-25T08:32:26Z</dc:date>
    </item>
  </channel>
</rss>

