<?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 Using functions for default param values in EG4.1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4062#M1279</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I want to use a function to define a default value for a parameter.&lt;BR /&gt;
&lt;BR /&gt;
This is how my param is defined:&lt;BR /&gt;
&lt;BR /&gt;
Type of Param: Date&lt;BR /&gt;
Name: StartDate&lt;BR /&gt;
Enclose user input with: Double quotes&lt;BR /&gt;
Default Value: intnx('month',today(),-1,'end')&lt;BR /&gt;
&lt;BR /&gt;
But the default Value I am putting in is not working.? I have also tried putting %sysfunc around it - but to no avail.&lt;BR /&gt;
&lt;BR /&gt;
Is is possible to use functions when specifying default values in Enterprise Guide 4.1?&lt;BR /&gt;
&lt;BR /&gt;
Many Thanks.</description>
    <pubDate>Mon, 06 Aug 2007 05:06:20 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-08-06T05:06:20Z</dc:date>
    <item>
      <title>Using functions for default param values in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4062#M1279</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I want to use a function to define a default value for a parameter.&lt;BR /&gt;
&lt;BR /&gt;
This is how my param is defined:&lt;BR /&gt;
&lt;BR /&gt;
Type of Param: Date&lt;BR /&gt;
Name: StartDate&lt;BR /&gt;
Enclose user input with: Double quotes&lt;BR /&gt;
Default Value: intnx('month',today(),-1,'end')&lt;BR /&gt;
&lt;BR /&gt;
But the default Value I am putting in is not working.? I have also tried putting %sysfunc around it - but to no avail.&lt;BR /&gt;
&lt;BR /&gt;
Is is possible to use functions when specifying default values in Enterprise Guide 4.1?&lt;BR /&gt;
&lt;BR /&gt;
Many Thanks.</description>
      <pubDate>Mon, 06 Aug 2007 05:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4062#M1279</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-06T05:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions for default param values in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4063#M1280</link>
      <description>I would prompt for a date, DefaultDate, default today, then use it to build StartDate in the code:&lt;BR /&gt;
&lt;BR /&gt;
%let StartDate="%sysfunc(&lt;BR /&gt;
putn(%sysfunc( intnx(month,&amp;amp;PromptDate,-1,end) ),date9.)&lt;BR /&gt;
)"d;&lt;BR /&gt;
%put StartDate=&amp;amp;StartDate;&lt;BR /&gt;
&lt;BR /&gt;
Colin</description>
      <pubDate>Mon, 06 Aug 2007 13:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4063#M1280</guid>
      <dc:creator>Colin</dc:creator>
      <dc:date>2007-08-06T13:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions for default param values in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4064#M1281</link>
      <description>Correction&lt;BR /&gt;
&lt;BR /&gt;
I would prompt for a date, PromptDate, default today, then use it to build StartDate in the code:&lt;BR /&gt;
&lt;BR /&gt;
%let StartDate="%sysfunc(&lt;BR /&gt;
putn(%sysfunc( intnx(month,&amp;amp;PromptDate,-1,end) ),date9.)&lt;BR /&gt;
)"d;&lt;BR /&gt;
%put StartDate=&amp;amp;StartDate;&lt;BR /&gt;
&lt;BR /&gt;
Colin</description>
      <pubDate>Mon, 06 Aug 2007 13:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4064#M1281</guid>
      <dc:creator>Colin</dc:creator>
      <dc:date>2007-08-06T13:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions for default param values in EG4.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4065#M1282</link>
      <description>Thanks Colin.&lt;BR /&gt;
&lt;BR /&gt;
This works.&lt;BR /&gt;
&lt;BR /&gt;
However, what I really want to do - is have an 'intelligent' default value displayed to the user and also give the user the ability to override if they need to.&lt;BR /&gt;
&lt;BR /&gt;
Therefore, I really want to be able to apply the date function to the default value of the parameter.  Ie. I want to put the date function as per below in Default value box in the Parameters Manager screen.... But I just can't get this to work... Perhaps its not possible?&lt;BR /&gt;
&lt;BR /&gt;
I have played with is a bit and it seems to me that SAS will ALWAYS run the built-in  Enterprise Guide macro code (for the parameter) first... and then run code that I write in a module after that.  I guess if there was a way to get it to run my code first it might be a way around this..?  (ie. write code to work out the default value of the Enterprise Guide parameter and get this code to somehow run first)&lt;BR /&gt;
&lt;BR /&gt;
Hope this makes sense.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Georgina.</description>
      <pubDate>Tue, 07 Aug 2007 03:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-functions-for-default-param-values-in-EG4-1/m-p/4065#M1282</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-07T03:04:02Z</dc:date>
    </item>
  </channel>
</rss>

