<?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: Cannot filter selection in prompt in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614711#M179770</link>
    <description>Magic!!!&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help. Works perfect!!!</description>
    <pubDate>Thu, 02 Jan 2020 08:14:02 GMT</pubDate>
    <dc:creator>sas_user_null</dc:creator>
    <dc:date>2020-01-02T08:14:02Z</dc:date>
    <item>
      <title>Cannot filter selection in prompt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614530#M179664</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a prompt with static list. When I run it creates the following variables:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET Selected_Scenarios_count = 3;&lt;BR /&gt;%LET Selected_Scenarios0 = 3;&lt;BR /&gt;%LET Selected_Scenarios = Base;&lt;BR /&gt;%LET Selected_Scenarios3 = Down;&lt;BR /&gt;%LET Selected_Scenarios2 = Up;&lt;BR /&gt;%LET Selected_Scenarios1 = Base;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to execute a part of the code only for the Up and Down scenarios. However it runs for all the scenarios. Moreover it does not do the calculation. I am also sharing the input and output data with only 100 rows. My goal is to have only two additional columns with "Naming_Up" and "Naming_Down" calculated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro my_sample();

data WORK.my_output;
set WORK.my_source;
		%do h=1 %to &amp;amp;Selected_Scenarios_count.;
		if &amp;amp;&amp;amp;selected_scenarios&amp;amp;h.. in('Up','Down') then Naming_&amp;amp;&amp;amp;selected_scenarios&amp;amp;h..=field1*field2;
		%end;
run;
%mend my_sample;
%my_sample();

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 09:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614530#M179664</guid>
      <dc:creator>sas_user_null</dc:creator>
      <dc:date>2019-12-31T09:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot filter selection in prompt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614536#M179670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/305117"&gt;@sas_user_null&lt;/a&gt;&amp;nbsp; &amp;nbsp;Perhaps you after this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%LET Selected_Scenarios_count = 3;
%LET Selected_Scenarios0 = 3;
%LET Selected_Scenarios = Base;
%LET Selected_Scenarios3 = Down;
%LET Selected_Scenarios2 = Up;
%LET Selected_Scenarios1 = Base;

options minoperator;
%macro my_sample()/mindelimiter=',';


		%do h=1 %to &amp;amp;Selected_Scenarios_count.;
		 %if &amp;amp;&amp;amp;selected_scenarios&amp;amp;h.. in(Up,Down) %then %do;
        Naming_&amp;amp;&amp;amp;selected_scenarios&amp;amp;h..=field1*field2;
		%end;
		%end;

%mend my_sample;
%my_sample();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, you can call the macro like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data WORK.my_output;
set WORK.my_source;
%my_sample();	
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 10:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614536#M179670</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-31T10:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot filter selection in prompt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614711#M179770</link>
      <description>Magic!!!&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help. Works perfect!!!</description>
      <pubDate>Thu, 02 Jan 2020 08:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-filter-selection-in-prompt/m-p/614711#M179770</guid>
      <dc:creator>sas_user_null</dc:creator>
      <dc:date>2020-01-02T08:14:02Z</dc:date>
    </item>
  </channel>
</rss>

