<?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 Multi-select prompt value not storing &amp;quot;count&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239517#M308815</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;I am using a multi-value prompt and have the code below. The prompt is called "DRGFilterCommas". I am getting a message when I run this that "DRGFilterCommas_Count" is not initialized and this is causing the program to work as intended (see below) even though earlier in the log it displays that the value of &lt;SPAN&gt;DRGFilterCommas_Count is 1&lt;/SPAN&gt;. Any ideas as to why this is?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;My code:&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;length DRGsCommas_List $10000; &lt;BR /&gt; if symget('DRGFilterCommas_Count')&amp;gt;=1 then do;&lt;BR /&gt; DRGsCommas_List=cats("'", tranwrd("&amp;amp;DRGFilterCommas", ",", "','"), "'");&lt;BR /&gt; put DRGsCommas_List; /* just for checking */&lt;BR /&gt; put DRGFilterCommas_COUNT; /* just for checking */&lt;BR /&gt; call symputx('DRGsCommas_WHERE_CLAUSE',cats('and dr.DRGCode in (',DRGsCommas_List,')'));&lt;BR /&gt; call symputx('DRGsCommas_JOIN_CLAUSE','INNER JOIN SQL_STG.DRG dr ON dr.DRGKey = e.DRGKey');&lt;BR /&gt; call symputx('DRGs_List_Displayed',DRGFilterCommas);&lt;BR /&gt; end;&lt;BR /&gt; else do;&lt;BR /&gt; call symputx('DRGs_List_Displayed',"ALL");&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Log shows the following:&lt;/P&gt;
&lt;P&gt;%LET DRGFilterCommas_count = 1;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Variable DRGFilterCommas_COUNT is uninitialized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;KelseyB&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2015 14:34:49 GMT</pubDate>
    <dc:creator>KelseyB</dc:creator>
    <dc:date>2015-12-16T14:34:49Z</dc:date>
    <item>
      <title>Multi-select prompt value not storing "count"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239517#M308815</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am using a multi-value prompt and have the code below. The prompt is called "DRGFilterCommas". I am getting a message when I run this that "DRGFilterCommas_Count" is not initialized and this is causing the program to work as intended (see below) even though earlier in the log it displays that the value of &lt;SPAN&gt;DRGFilterCommas_Count is 1&lt;/SPAN&gt;. Any ideas as to why this is?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;My code:&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;length DRGsCommas_List $10000; &lt;BR /&gt; if symget('DRGFilterCommas_Count')&amp;gt;=1 then do;&lt;BR /&gt; DRGsCommas_List=cats("'", tranwrd("&amp;amp;DRGFilterCommas", ",", "','"), "'");&lt;BR /&gt; put DRGsCommas_List; /* just for checking */&lt;BR /&gt; put DRGFilterCommas_COUNT; /* just for checking */&lt;BR /&gt; call symputx('DRGsCommas_WHERE_CLAUSE',cats('and dr.DRGCode in (',DRGsCommas_List,')'));&lt;BR /&gt; call symputx('DRGsCommas_JOIN_CLAUSE','INNER JOIN SQL_STG.DRG dr ON dr.DRGKey = e.DRGKey');&lt;BR /&gt; call symputx('DRGs_List_Displayed',DRGFilterCommas);&lt;BR /&gt; end;&lt;BR /&gt; else do;&lt;BR /&gt; call symputx('DRGs_List_Displayed',"ALL");&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Log shows the following:&lt;/P&gt;
&lt;P&gt;%LET DRGFilterCommas_count = 1;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Variable DRGFilterCommas_COUNT is uninitialized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;KelseyB&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 14:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239517#M308815</guid>
      <dc:creator>KelseyB</dc:creator>
      <dc:date>2015-12-16T14:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-select prompt value not storing "count"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239525#M308816</link>
      <description>&lt;P&gt;Macro variables and DATA step variables are not the same thing.&amp;nbsp; It's probably too large a topic to try to go into detail here, except to say that macro variables are not contained within a SAS DATA set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend two changes.&amp;nbsp; First, get rid of the diagnostic statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put DRGFilterCommas_COUNT; /* just for checking */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And change this statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if symget('DRGFilterCommas_Count')&amp;gt;=1 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on what I think you are trying to accomplish, it should look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if &amp;amp;DRGFilterCommas_Count&amp;gt;=1 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 15:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239525#M308816</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-16T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-select prompt value not storing "count"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239538#M308817</link>
      <description>&lt;P&gt;Thank you Astounding. &amp;nbsp;That worked!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 15:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multi-select-prompt-value-not-storing-quot-count-quot/m-p/239538#M308817</guid>
      <dc:creator>KelseyB</dc:creator>
      <dc:date>2015-12-16T15:25:08Z</dc:date>
    </item>
  </channel>
</rss>

