<?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: Varying Parameters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66378#M14405</link>
    <description>IN operator will accept blank delimited lists.</description>
    <pubDate>Tue, 17 May 2011 14:44:03 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-05-17T14:44:03Z</dc:date>
    <item>
      <title>Varying Parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66377#M14404</link>
      <description>sgrp1 and sgrp2 can both have parameter values or there could be only one value passed.&lt;BR /&gt;
in the below code there values for both sgrp1 and sgrp2.&lt;BR /&gt;
so the dataset to be created is stage4046.&lt;BR /&gt;
&lt;BR /&gt;
if there is value for sgrp1 and no value for sgrp2.&lt;BR /&gt;
say sgrp1 is 5.the where condition will fail due to syntax errors.&lt;BR /&gt;
&lt;BR /&gt;
is there a way to automate this,no matter how many values we pass?&lt;BR /&gt;
&lt;BR /&gt;
%macro stage(sgrp1=,sgrp2=)&lt;BR /&gt;
data stage&amp;amp;sgrp1.&amp;amp;sgrp2.;&lt;BR /&gt;
 set Clsindx(where=(slsgrp in (&amp;amp;sgrp1,&amp;amp;sgrp2)));&lt;BR /&gt;
run;&lt;BR /&gt;
%mend clsstage;&lt;BR /&gt;
%clsstage(sgrp1=40,sgrp2=46);</description>
      <pubDate>Tue, 17 May 2011 14:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66377#M14404</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-05-17T14:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Varying Parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66378#M14405</link>
      <description>IN operator will accept blank delimited lists.</description>
      <pubDate>Tue, 17 May 2011 14:44:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66378#M14405</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-05-17T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Varying Parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66379#M14406</link>
      <description>Maybe this helps:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%macro filter(ages=);&lt;BR /&gt;
	%local datasetPostfix;&lt;BR /&gt;
	%let datasetPostfix = %sysfunc(compress(&amp;amp;ages, %str( )));&lt;BR /&gt;
	data work.Class&amp;amp;datasetPostfix;&lt;BR /&gt;
		set sashelp.class;&lt;BR /&gt;
		where age in (&amp;amp;ages);&lt;BR /&gt;
	run;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%filter(ages=13 15);[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Works as long as you pass at least one value.</description>
      <pubDate>Tue, 17 May 2011 15:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Varying-Parameters/m-p/66379#M14406</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2011-05-17T15:07:47Z</dc:date>
    </item>
  </channel>
</rss>

