<?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 handle multiple selection prompts in Developers</title>
    <link>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51443#M2970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;You could also grab the %_eg_whereparam macro code from Enterprise Guide and leverage that in stored processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angela&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Apr 2012 15:02:52 GMT</pubDate>
    <dc:creator>AngelaHall</dc:creator>
    <dc:date>2012-04-06T15:02:52Z</dc:date>
    <item>
      <title>How to handle multiple selection prompts</title>
      <link>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51441#M2968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cynthia wrote a very nice description of how multiple selection prompts are converted to global macro variables for stored processes over on this thread.&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/message/121828#121828"&gt;https://communities.sas.com/message/121828#121828&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It makes me wonder if anyone has suggestions on best processes for handling this to make coding of the stored process easier.&lt;/P&gt;&lt;P&gt;For example to me the fact that the first value selected might be in &amp;amp;MVAR or &amp;amp;MVAR1 or there might not even be a global macro variable defined should be straightened out before I can get to writing my program logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thinking about it quickly I am up with this simple data step to make sure that the macro variable is defined.&lt;/P&gt;&lt;P&gt;I wonder what others are doing.&amp;nbsp; Or how to adapt it so that it also handles the variation of which macro variables are created when using SAS/Intrnet or EG instead of stored processes.&lt;/P&gt;&lt;P&gt;Just set the root macro variable name in the variable MVAR and the default value you want in the variable DEFAULT.&amp;nbsp; This example shows who to use %STR( ) to allow setting the default to a single space instead of an empty macro variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;%let country_count=0;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; mvar='country';&lt;/P&gt;&lt;P&gt;&amp;nbsp; default='%str( )';&lt;/P&gt;&lt;P&gt;&amp;nbsp; count=input(symget(cats(mvar,'_count')),best.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx(cats(mvar,'0'),count);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if count&amp;lt;1 then call symputx(mvar,default);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if count&amp;lt;2 then call symputx(cats(mvar,'1'),symget(mvar));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put country="&amp;amp;country" _count="&amp;amp;country_count" 0="&amp;amp;country0" 1="&amp;amp;country1" ;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Mar 2012 16:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51441#M2968</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-31T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle multiple selection prompts</title>
      <link>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51442#M2969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the multipleNames macro which I posted to sasCommunity.org:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/The_multipleNames_Macro"&gt;http://www.sascommunity.org/wiki/The_multipleNames_Macro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The article includes the source and the comments talk about the fact that its origin was for the SAS/IntrNet Application Dispatcher, specifically my SAS Press book:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Building_Web_Applications_with_SAS/IntrNet:_A_Guide_to_the_Application_Dispatcher"&gt;http://www.sascommunity.org/wiki/Building_Web_Applications_with_SAS/IntrNet:_A_Guide_to_the_Application_Dispatcher&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it also works for the Stored Process Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use it all the time for parameters that can have multiple values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 14:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51442#M2969</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2012-04-06T14:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle multiple selection prompts</title>
      <link>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51443#M2970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;You could also grab the %_eg_whereparam macro code from Enterprise Guide and leverage that in stored processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angela&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 15:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-to-handle-multiple-selection-prompts/m-p/51443#M2970</guid>
      <dc:creator>AngelaHall</dc:creator>
      <dc:date>2012-04-06T15:02:52Z</dc:date>
    </item>
  </channel>
</rss>

