<?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 Looping through a set of parameters in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3193#M1688</link>
    <description>I have a parameter that has several possible entries, i.e., for supervisors, the parameters that can be chosen can be up to 5 in total.  To "pull in" the parameters and subsequently use them as part of an IN comparison in a PROC SQL, I have the following code:&lt;BR /&gt;
&lt;BR /&gt;
To pull in the parameters:&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;supvcodes0 = %str() %then %do;&lt;BR /&gt;
    %let supvcodesval = "&amp;amp;supervisorycodes";&lt;BR /&gt;
    %end;&lt;BR /&gt;
        %else %do;&lt;BR /&gt;
        %do i = 1 %to %supvcodes0;&lt;BR /&gt;
        %let supvcodesval = &amp;amp;supvcodesval " " "&amp;amp;&amp;amp;supvcodes&amp;amp;i";&lt;BR /&gt;
        %end;&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
To compare my data against the parameters in my PROC SQL:&lt;BR /&gt;
&lt;BR /&gt;
(PERSON_DETAIL.SUPERVISOR_CATEGORY IN (&amp;amp;supvcodesval))&lt;BR /&gt;
&lt;BR /&gt;
Is this valid code and logic?  The reason I ask is that it appears my code, as shown in a PROC REPORT, only hsows records for my first parameter value and not for other values in the same parameter.  If there is a better way of doing what I'm attempting, would someone please respond?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance to any who reply....looking forward to your suggestions.</description>
    <pubDate>Wed, 23 May 2007 21:33:59 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-05-23T21:33:59Z</dc:date>
    <item>
      <title>Looping through a set of parameters</title>
      <link>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3193#M1688</link>
      <description>I have a parameter that has several possible entries, i.e., for supervisors, the parameters that can be chosen can be up to 5 in total.  To "pull in" the parameters and subsequently use them as part of an IN comparison in a PROC SQL, I have the following code:&lt;BR /&gt;
&lt;BR /&gt;
To pull in the parameters:&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;supvcodes0 = %str() %then %do;&lt;BR /&gt;
    %let supvcodesval = "&amp;amp;supervisorycodes";&lt;BR /&gt;
    %end;&lt;BR /&gt;
        %else %do;&lt;BR /&gt;
        %do i = 1 %to %supvcodes0;&lt;BR /&gt;
        %let supvcodesval = &amp;amp;supvcodesval " " "&amp;amp;&amp;amp;supvcodes&amp;amp;i";&lt;BR /&gt;
        %end;&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
To compare my data against the parameters in my PROC SQL:&lt;BR /&gt;
&lt;BR /&gt;
(PERSON_DETAIL.SUPERVISOR_CATEGORY IN (&amp;amp;supvcodesval))&lt;BR /&gt;
&lt;BR /&gt;
Is this valid code and logic?  The reason I ask is that it appears my code, as shown in a PROC REPORT, only hsows records for my first parameter value and not for other values in the same parameter.  If there is a better way of doing what I'm attempting, would someone please respond?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance to any who reply....looking forward to your suggestions.</description>
      <pubDate>Wed, 23 May 2007 21:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3193#M1688</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-05-23T21:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a set of parameters</title>
      <link>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3194#M1689</link>
      <description>Hi: &lt;BR /&gt;
  These previous forum responses may be useful to you:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=1532׼" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=1532׼&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=3088ఐ" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=3088ఐ&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
Generally when you are dealing with a test for a null macro variable the test is coded as:&lt;BR /&gt;
   &lt;BR /&gt;
%if &amp;amp;macvar =;  (macro variable has a NULL value which means that, in your case, no value was sent by the client application to the server)&lt;BR /&gt;
or &lt;BR /&gt;
%if &amp;amp;macvar ne ; (macro variable has SOME value you don't yet know what)&lt;BR /&gt;
or&lt;BR /&gt;
%if %upcase(&amp;amp;macvar) eq WOMBAT %then %do; (when you compare a macro variable to a text string, you don't need quotes).&lt;BR /&gt;
 &lt;BR /&gt;
Have you coded and tested in PROC REPORT, what a working where statement would look like:&lt;BR /&gt;
where somevar in ("val1", "val2", "val3"); ???&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 23 May 2007 23:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3194#M1689</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-05-23T23:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through a set of parameters</title>
      <link>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3195#M1690</link>
      <description>Thank you for your timely response, Cynthia!  I was quite close on my code, but I think your suggested links will put me onth tohe correct path.  I appreciate you being so helpful, and I also appreciate your knowledge!</description>
      <pubDate>Thu, 24 May 2007 13:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Looping-through-a-set-of-parameters/m-p/3195#M1690</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-05-24T13:31:24Z</dc:date>
    </item>
  </channel>
</rss>

