<?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: Creating parameters with code to use later in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-parameters-with-code-to-use-later/m-p/24858#M3746</link>
    <description>First off, are you running EG 4.1 or EG 4.2? EG 4.2 has some nice additions to date prompts, including support for intervals like month and year.&lt;BR /&gt;
&lt;BR /&gt;
If you're using EG 4.2, try the following:&lt;BR /&gt;
&lt;BR /&gt;
1. Select View / Prompt Manager.&lt;BR /&gt;
2. Click Add to begin creating a new prompt. After picking a name etc., go to the second tab. Make it a date prompt, user enters values, date type of Month.&lt;BR /&gt;
&lt;BR /&gt;
When the prompt gets used, it will create serveral macro variables behind the scenes. Let's say, for example, you called your prompt MP_new. After supplying a prompt value like January 2003, the code behind the scenes would have the following macro variable values available:&lt;BR /&gt;
&lt;BR /&gt;
1. MP_new_label = January 2003&lt;BR /&gt;
2. MP_new= 01Jan2003&lt;BR /&gt;
3. MP_new_end = 31Jan2003&lt;BR /&gt;
&lt;BR /&gt;
Using a filter in the query builder, you could then create an advanced filter. If you column was date_column_1 then:&lt;BR /&gt;
&lt;BR /&gt;
date_column_1 between "&amp;amp;MP_new"d and "MP_new_end"d&lt;BR /&gt;
&lt;BR /&gt;
Sadly, I don't see a point-and-click way to easily create this filter... but at least the month prompt interface makes choosing a value easier. Someone else on the forum might have a slicker solution for the filter part.</description>
    <pubDate>Tue, 25 May 2010 18:16:18 GMT</pubDate>
    <dc:creator>RichardH_sas</dc:creator>
    <dc:date>2010-05-25T18:16:18Z</dc:date>
    <item>
      <title>Creating parameters with code to use later</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-parameters-with-code-to-use-later/m-p/24857#M3745</link>
      <description>In my example I have a data set the I want to retrieve for a certain time period to perform further analysis on.  In order to get the correct data set there a number of date variables that are used to speficy the ranges of various variables.  However, as far as the user is concerned they only want data for a specific time period, e.g. month.  Therefore, it seems over complicated to prompt them for a number of different dates to specify.&lt;BR /&gt;
&lt;BR /&gt;
So if I create a parameter that prompts the user for a specific month is it possible to use some code somewhere to convert this month into the variables I require further down the line in my queries.  &lt;BR /&gt;
&lt;BR /&gt;
For example the user enter Jan and it is storer in the parameter &amp;amp;Month.  Can I then create date value parameters such as &amp;amp;MonthStart (equal to 01Jan2010) and &amp;amp;MonthEnd (equal to 31Jan2010).   This example is a simplification but does illustrate what I would like to do - is this possible?  Thanks.</description>
      <pubDate>Thu, 20 May 2010 09:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-parameters-with-code-to-use-later/m-p/24857#M3745</guid>
      <dc:creator>max00d</dc:creator>
      <dc:date>2010-05-20T09:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating parameters with code to use later</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-parameters-with-code-to-use-later/m-p/24858#M3746</link>
      <description>First off, are you running EG 4.1 or EG 4.2? EG 4.2 has some nice additions to date prompts, including support for intervals like month and year.&lt;BR /&gt;
&lt;BR /&gt;
If you're using EG 4.2, try the following:&lt;BR /&gt;
&lt;BR /&gt;
1. Select View / Prompt Manager.&lt;BR /&gt;
2. Click Add to begin creating a new prompt. After picking a name etc., go to the second tab. Make it a date prompt, user enters values, date type of Month.&lt;BR /&gt;
&lt;BR /&gt;
When the prompt gets used, it will create serveral macro variables behind the scenes. Let's say, for example, you called your prompt MP_new. After supplying a prompt value like January 2003, the code behind the scenes would have the following macro variable values available:&lt;BR /&gt;
&lt;BR /&gt;
1. MP_new_label = January 2003&lt;BR /&gt;
2. MP_new= 01Jan2003&lt;BR /&gt;
3. MP_new_end = 31Jan2003&lt;BR /&gt;
&lt;BR /&gt;
Using a filter in the query builder, you could then create an advanced filter. If you column was date_column_1 then:&lt;BR /&gt;
&lt;BR /&gt;
date_column_1 between "&amp;amp;MP_new"d and "MP_new_end"d&lt;BR /&gt;
&lt;BR /&gt;
Sadly, I don't see a point-and-click way to easily create this filter... but at least the month prompt interface makes choosing a value easier. Someone else on the forum might have a slicker solution for the filter part.</description>
      <pubDate>Tue, 25 May 2010 18:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-parameters-with-code-to-use-later/m-p/24858#M3746</guid>
      <dc:creator>RichardH_sas</dc:creator>
      <dc:date>2010-05-25T18:16:18Z</dc:date>
    </item>
  </channel>
</rss>

