<?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: Parameter values in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4106#M1301</link>
    <description>Hi, Cheri,&lt;BR /&gt;
&lt;BR /&gt;
Here is a suggestion (please keep in mind the pseudo code in my reply is not the exact code you will need):&lt;BR /&gt;
&lt;BR /&gt;
In a data step:&lt;BR /&gt;
&lt;BR /&gt;
If parm2 eq &lt;BR /&gt;
    then parm2 = parm1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The data step must have the run; command as its last line.&lt;BR /&gt;
&lt;BR /&gt;
I'm assuming you will be using a Proc SQL later, so you would then, in Proc Sql, have something like the following:&lt;BR /&gt;
&lt;BR /&gt;
Proc Sql;&lt;BR /&gt;
CREATE TABLE YourTable AS SELECT field1, field2	 &lt;BR /&gt;
 FROM YourOtherTable AS CallItWhatever &lt;BR /&gt;
WHERE YourOtherTable.field1 BETWEEN "&amp;amp;parm1" and "&amp;amp;parm2";&lt;BR /&gt;
Quit;&lt;BR /&gt;
&lt;BR /&gt;
Don't forget....you might need to include logic in your data step that checks to make sure the second parm is equal to or larger than the first parm, but not smaller than the first parm.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps.  Also, in these forums, there is a lady from SAS, by the name of Cynthia, who has been a tremendous help to me.  If you can catch her attention, she is wonderful on replying and on helping!</description>
    <pubDate>Fri, 10 Aug 2007 13:48:00 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-08-10T13:48:00Z</dc:date>
    <item>
      <title>Parameter values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4105#M1300</link>
      <description>I am using 2 parameters. One is for the low range the other is for the high range.  Both are drop downs with a list of values.  I want the user to be able to only put in the low value if they only want 1 value and not a range. In that case I need the 2nd parameter to = the first parmeter.&lt;BR /&gt;
&lt;BR /&gt;
Any idea on how to do this?? I have tried multiple things and nothing seems to work. Like making the default of parmeter2  parameter1. Probably just not doing something quite right.&lt;BR /&gt;
&lt;BR /&gt;
example.... parm1 ...selects  0012&lt;BR /&gt;
                 parm 2    selects 0014    then the result is everthing from 0012 to 0014&lt;BR /&gt;
&lt;BR /&gt;
example2  parm1  selects 0012&lt;BR /&gt;
                parm2 nothing selected  then only want 0012 results.</description>
      <pubDate>Wed, 08 Aug 2007 16:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4105#M1300</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-08T16:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4106#M1301</link>
      <description>Hi, Cheri,&lt;BR /&gt;
&lt;BR /&gt;
Here is a suggestion (please keep in mind the pseudo code in my reply is not the exact code you will need):&lt;BR /&gt;
&lt;BR /&gt;
In a data step:&lt;BR /&gt;
&lt;BR /&gt;
If parm2 eq &lt;BR /&gt;
    then parm2 = parm1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The data step must have the run; command as its last line.&lt;BR /&gt;
&lt;BR /&gt;
I'm assuming you will be using a Proc SQL later, so you would then, in Proc Sql, have something like the following:&lt;BR /&gt;
&lt;BR /&gt;
Proc Sql;&lt;BR /&gt;
CREATE TABLE YourTable AS SELECT field1, field2	 &lt;BR /&gt;
 FROM YourOtherTable AS CallItWhatever &lt;BR /&gt;
WHERE YourOtherTable.field1 BETWEEN "&amp;amp;parm1" and "&amp;amp;parm2";&lt;BR /&gt;
Quit;&lt;BR /&gt;
&lt;BR /&gt;
Don't forget....you might need to include logic in your data step that checks to make sure the second parm is equal to or larger than the first parm, but not smaller than the first parm.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps.  Also, in these forums, there is a lady from SAS, by the name of Cynthia, who has been a tremendous help to me.  If you can catch her attention, she is wonderful on replying and on helping!</description>
      <pubDate>Fri, 10 Aug 2007 13:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4106#M1301</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-10T13:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4107#M1302</link>
      <description>Sticking to the EG logic, you can define your second parameter (let's say it's called MAX and the first one MIN) with &amp;amp;MIN as the default value.&lt;BR /&gt;
In your condition, specify :&lt;BR /&gt;
yourVariable&lt;BR /&gt;
BETWEEN&lt;BR /&gt;
&amp;amp;min AND %UNQUOTE(&amp;amp;max)&lt;BR /&gt;
&lt;BR /&gt;
By default, EG prevents using more than one step of macro-variable (parameters) resolutions. So the &amp;amp;max --&amp;gt; &amp;amp;min --&amp;gt; value is forbidden by default : that's why default values for parameters are enclosed in %NRSTR() function calls at the beginning of the code.&lt;BR /&gt;
Using the %UNQUOTE function will cancel the effect of the %NRSTR protection and allow your definition of &amp;amp;max being equal to &amp;amp;min.&lt;BR /&gt;
&lt;BR /&gt;
And any user value overriding the &amp;amp;min value for MAX will also work out fine (at least on the example I've used to test).&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Olivier</description>
      <pubDate>Fri, 10 Aug 2007 13:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Parameter-values/m-p/4107#M1302</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2007-08-10T13:59:51Z</dc:date>
    </item>
  </channel>
</rss>

