<?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 How to resolve a macro variable from prompt for Selecting Multiple Variables from a List in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448654#M29029</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a text prompt &lt;STRONG&gt;"Variable_List"&amp;nbsp;&lt;/STRONG&gt;with Multiple Values. I want to resolve this Text Type macro in my code.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Prompt.PNG" style="width: 486px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19448i18AEEA0B165A917E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Prompt.PNG" alt="Prompt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Previously, I was using limited number of variables with manual input in the macro variable &lt;STRONG&gt;" varlist".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let varlist = TBM_STAGE1 TBM_STAGE2 SHIFT_BUILD_DATE BLADDER;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was using the below format for count and then loop across these variables to get the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*4.Looping through the Variables and checking the Data Type with Put Statement at the end*/
		%do I=1 %to %sysfunc(countw(&amp;amp;varlist)); 
					%let var = %scan(&amp;amp;varlist, &amp;amp;I);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My question is I just have to Substitute the &lt;STRONG&gt;&amp;amp;varlist&lt;/STRONG&gt; with &amp;amp;&lt;STRONG&gt;Variable_List. &lt;/STRONG&gt;in the Do statement? Kindly let me know if you need further input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Mar 2018 14:49:21 GMT</pubDate>
    <dc:creator>narulap</dc:creator>
    <dc:date>2018-03-26T14:49:21Z</dc:date>
    <item>
      <title>How to resolve a macro variable from prompt for Selecting Multiple Variables from a List</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448654#M29029</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a text prompt &lt;STRONG&gt;"Variable_List"&amp;nbsp;&lt;/STRONG&gt;with Multiple Values. I want to resolve this Text Type macro in my code.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Prompt.PNG" style="width: 486px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19448i18AEEA0B165A917E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Prompt.PNG" alt="Prompt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Previously, I was using limited number of variables with manual input in the macro variable &lt;STRONG&gt;" varlist".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let varlist = TBM_STAGE1 TBM_STAGE2 SHIFT_BUILD_DATE BLADDER;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was using the below format for count and then loop across these variables to get the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*4.Looping through the Variables and checking the Data Type with Put Statement at the end*/
		%do I=1 %to %sysfunc(countw(&amp;amp;varlist)); 
					%let var = %scan(&amp;amp;varlist, &amp;amp;I);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My question is I just have to Substitute the &lt;STRONG&gt;&amp;amp;varlist&lt;/STRONG&gt; with &amp;amp;&lt;STRONG&gt;Variable_List. &lt;/STRONG&gt;in the Do statement? Kindly let me know if you need further input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 14:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448654#M29029</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-26T14:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve a macro variable from prompt for Selecting Multiple Variables from a List</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448674#M29032</link>
      <description>&lt;P&gt;SAS creates an additional variable named "Variable_List_Count" and sets it to the number of values selected. If more than one value was selected, than the values are in the variables "Variable_List1", "Variable_List2" ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following step should create the macro-variable varlist in the already used format. &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   length varList $ 1000;

   do i = 1 to &amp;amp;Variable_List_Count.;
      if i = 1 then do;
         varlist = catx(' ', varList, symget("Variable_List"));
      end;
      else do;
         varlist = catx(' ', varList, symget(cats("Variable_List", i)));
      end;
   end;

   call symputx('varList', varList);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448674#M29032</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-03-26T15:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve a macro variable from prompt for Selecting Multiple Variables from a List</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448971#M29051</link>
      <description>&lt;P&gt;Perfect!!! Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;for explaining the concept behind the&amp;nbsp; work and the code is working&amp;nbsp;exactly what I needed &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 13:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-resolve-a-macro-variable-from-prompt-for-Selecting/m-p/448971#M29051</guid>
      <dc:creator>narulap</dc:creator>
      <dc:date>2018-03-27T13:29:59Z</dc:date>
    </item>
  </channel>
</rss>

