<?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: date prompt in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673134#M36565</link>
    <description>&lt;P&gt;As I don't use Enterprise Guide, I can't specifically answer about a prompt that the user has to fill in.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 14:05:03 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-07-29T14:05:03Z</dc:date>
    <item>
      <title>date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673108#M36562</link>
      <description>&lt;P&gt;Is there a way to insert a prompt in your where statement to filter for the date. Below is the code the way I tried it, but it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=SOMEDATA;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where datepart(error_dt) &amp;gt; '&amp;amp;date';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where error_dt is a date variable.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 13:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673108#M36562</guid>
      <dc:creator>RubenPloeg</dc:creator>
      <dc:date>2020-07-29T13:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673122#M36563</link>
      <description>&lt;P&gt;This works&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=somedata;
    where error_dt &amp;gt; '01JAN2020'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For future reference, saying "but it doesn't work" and providing no further details usually is not a good thing to do ... you need to provide details (the LOG and/or incorrect outputs) about what happened so we can all see what didn't work.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 13:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673122#M36563</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-29T13:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673132#M36564</link>
      <description>&lt;P&gt;I know that inserting a date will work, but it doesn't allow the user to choose a date from a prompt. That was what i was referring to. The error I get when trying to use a prompt is that the where clause operator requires compatible variables. Thus, I'm pretty sure this way I will not be able to work with a prompt for the date. My question was, is there another way?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 13:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673132#M36564</guid>
      <dc:creator>RubenPloeg</dc:creator>
      <dc:date>2020-07-29T13:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673134#M36565</link>
      <description>&lt;P&gt;As I don't use Enterprise Guide, I can't specifically answer about a prompt that the user has to fill in.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673134#M36565</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-29T14:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673136#M36566</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/325511"&gt;@RubenPloeg&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I know that inserting a date will work, but it doesn't allow the user to choose a date from a prompt. That was what i was referring to. The error I get when trying to use a prompt is that the where clause operator requires compatible variables. Thus, I'm pretty sure this way I will not be able to work with a prompt for the date. My question was, is there another way?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't use prompts but I think it will set the macro variable to a string that looks like the date value when printed with the DATE9 format.&amp;nbsp; So you could use it to make a date literal in your code.&amp;nbsp; If the macro variable created is named DATE then you want to use&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;date"d&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in your code.&amp;nbsp; Note that double quotes instead of single is needed to allow the macro process to convert &amp;amp;date into the value of DATE.&amp;nbsp; The letter D is need to let SAS know that you want it to treat this as a date value and not a string.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673136#M36566</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-29T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673149#M36567</link>
      <description>&lt;UL&gt;
&lt;LI&gt;to resolve a macro variable in a quoted string, you must use double quotes&lt;/LI&gt;
&lt;LI&gt;if a variable is already a date (and not a datetime), do NOT use the DATEPART function&lt;/LI&gt;
&lt;LI&gt;to convert the string from the prompt to a date value, you must add a trailing d immediately following the closing double quote ("&amp;amp;date"d)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673149#M36567</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-29T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: date prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673151#M36568</link>
      <description>&lt;P&gt;the double qutes helped, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/date-prompt/m-p/673151#M36568</guid>
      <dc:creator>RubenPloeg</dc:creator>
      <dc:date>2020-07-29T14:37:17Z</dc:date>
    </item>
  </channel>
</rss>

