<?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: condition steps based promot with multiple values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120494#M24761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is your macro variable Month_Count initialized ? And what about your macro variables Month_Count1, Month_Count2, Month_Count3...etc ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2013 16:38:59 GMT</pubDate>
    <dc:creator>Florent</dc:creator>
    <dc:date>2013-06-27T16:38:59Z</dc:date>
    <item>
      <title>condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120491#M24758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a condition step data step based on a promot which could have more than values &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the orignial dataset&lt;BR /&gt;data toy_price;&lt;/P&gt;&lt;P&gt;infile datalines delimiter=',';&lt;/P&gt;&lt;P&gt;input toy$ cost;&lt;/P&gt;&lt;P&gt;AB,1&lt;/P&gt;&lt;P&gt;AC,10&lt;/P&gt;&lt;P&gt;CD,1&lt;/P&gt;&lt;P&gt;xx,1&lt;/P&gt;&lt;P&gt;AC,2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is promot(MONTH) which use could have select values from a list: Jan, Feb, March, April.As long as user selected Feb, like Jan, Feb, or Feb and March, or Jan, Feb and April, I want to execute a datastep, creating a new data set data TOYS. data TOYs; set TOY_PRICE: run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I implement the code like below:&lt;/P&gt;&lt;P&gt;%macro TOYS_OUT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do i=1 %to &amp;amp;Month_COUNT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if "&amp;amp;&amp;amp;MONTH_COUNT&amp;amp;i" = 'En' %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data TOYS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set TOY_PRICE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend; &lt;/P&gt;&lt;P&gt;%TOYS_OUT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;somehow it does not work. The TOYs dataset is not generated at all. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 00:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120491#M24758</guid>
      <dc:creator>YW_CA</dc:creator>
      <dc:date>2013-06-27T00:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120492#M24759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macro is based on text . He take everything as text, you don't need quote either double or single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if "&amp;amp;&amp;amp;MONTH_COUNT&amp;amp;i" = 'En' %then %do;&lt;/P&gt;&lt;P&gt;----&amp;gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;&amp;amp;MONTH_COUNT&amp;amp;i = En %then %do;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 01:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120492#M24759</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-06-27T01:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120493#M24760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;warning and error:&lt;/P&gt;&lt;P&gt;WARNING: APPARENET SYMBOLIC REFERENCE MONTH_COUNT1 NOT RESOLVED.&lt;/P&gt;&lt;P&gt;ERROR: A character was found in the $EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp;MONTH_COUNT=FEB&lt;/P&gt;&lt;P&gt;ERROR: The macro TOYS_OUT will stop executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somehow, the refernece the prompt value is not recognized?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 15:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120493#M24760</guid>
      <dc:creator>YW_CA</dc:creator>
      <dc:date>2013-06-27T15:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120494#M24761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is your macro variable Month_Count initialized ? And what about your macro variables Month_Count1, Month_Count2, Month_Count3...etc ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 16:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120494#M24761</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2013-06-27T16:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120495#M24762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a prompt, user can selected mutiple values from a static list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 17:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120495#M24762</guid>
      <dc:creator>YW_CA</dc:creator>
      <dc:date>2013-06-27T17:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120496#M24763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well obviously there is something wrong with the initialization of the macro variable month_count1. Have you checked the value of i ? Is it correctly put in the log by the %put statement you have ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a thought but maybe there are blanks causing the macro variable not to resolve correctly with the double ampersand. Can you try something like as follow ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %if %left(&amp;amp;&amp;amp;MONTH_COUNT&amp;amp;i) = En %then %do;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 17:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120496#M24763</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2013-06-27T17:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: condition steps based promot with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120497#M24764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It generates different macro variables based on the number of choices a user makes.&lt;/P&gt;&lt;P&gt;My understanding is that you should have MONTH and MOUNT_COUNT.&amp;nbsp; If the count is greater than one then you will also have MOUNT1, MONTH2, etc.&lt;/P&gt;&lt;P&gt;It does not look to me like you are using the right macro variable names, but anyway you should probably add:&lt;/P&gt;&lt;P&gt;%let month1 = &amp;amp;month ;&lt;/P&gt;&lt;P&gt;To you program so that MONTH1 will be sure to have a value with COUNT=1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let month1 = &amp;amp;month ;&lt;/P&gt;&lt;P&gt;%do i=1 %to &amp;amp;month_count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if "&amp;amp;&amp;amp;month&amp;amp;i" = "Jan" %then %do; .....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 17:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/condition-steps-based-promot-with-multiple-values/m-p/120497#M24764</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-27T17:48:29Z</dc:date>
    </item>
  </channel>
</rss>

