<?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: intnx for previous eom date, not working in proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629413#M186132</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313784"&gt;@Mary001&lt;/a&gt;&amp;nbsp; I tested the below(your code) and it seems to work fine&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select *

from abc

where date = intnx('month',today(),-1,'e');
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Mar 2020 13:22:25 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-03-04T13:22:25Z</dc:date>
    <item>
      <title>intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629410#M186130</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a proc sql (SAS EG 7.1) and in the where clause is a date variable but instead of putting a hard date, I would like to use something similar to the intnx function to dynamically get the previous month's date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Users will be running the sql at any given time and it should always use the previous EOM date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's what I have now ...&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from abc&lt;/P&gt;&lt;P&gt;where date = '1/31/2020'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried this and get this error,&amp;nbsp;SQL0440N No authorized routine named "TODAY" of type "FUNCTION"&lt;BR /&gt;having compatible arguments was found. SQLSTATE=42884&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from abc&lt;/P&gt;&lt;P&gt;where date = intnx('month',today(),-1,e)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is something simple, can someone please help? Thank you so much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629410#M186130</guid>
      <dc:creator>Mary001</dc:creator>
      <dc:date>2020-03-04T13:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629412#M186131</link>
      <description>&lt;P&gt;&lt;SPAN&gt;SQL0440N is a IBM DB/2 ERROR code, so this happens in a piece of explicit pass-through code. In explicit pass-through, you have to use the syntax of the target DBMS.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629412#M186131</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-04T13:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629413#M186132</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313784"&gt;@Mary001&lt;/a&gt;&amp;nbsp; I tested the below(your code) and it seems to work fine&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select *

from abc

where date = intnx('month',today(),-1,'e');
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629413#M186132</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-04T13:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629414#M186133</link>
      <description>&lt;P&gt;Is your SQL trying to extract from a database via a passthru? Can you show us the entire PROC SQL and not selected parts?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The TODAY() function does not work with most databases in a passthru.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629414#M186133</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-04T13:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629417#M186134</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, the sql is going to a db2 database to get the filtered data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;The TODAY() function does not work with most databases in a passthru." = Does this mean I need to find a db2 solution?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629417#M186134</guid>
      <dc:creator>Mary001</dc:creator>
      <dc:date>2020-03-04T13:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629418#M186135</link>
      <description>&lt;P&gt;I have found this in&amp;nbsp;&lt;A href="https://it.toolbox.com/question/last-and-first-date-for-a-month-in-db2-120308" target="_blank" rel="noopener"&gt;https://it.toolbox.com/question/last-and-first-date-for-a-month-in-db2-120308&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In DB2, the last day of last month is:&lt;/P&gt;
&lt;P&gt;CURRENT DATE - (DAY(CURRENT DATE)) DAYS&lt;/P&gt;
&lt;P&gt;The first day of this month is:&lt;/P&gt;
&lt;P&gt;CURRENT DATE - (DAY(CURRENT DATE) - 1) DAYS&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629418#M186135</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-04T13:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: intnx for previous eom date, not working in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629419#M186136</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313784"&gt;@Mary001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, the sql is going to a db2 database to get the filtered data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;The TODAY() function does not work with most databases in a passthru." = Does this mean I need to find a db2 solution?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Absolutely. As soon as you enter explicit pass-through, you (temporarily) leave the world of SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-for-previous-eom-date-not-working-in-proc-sql/m-p/629419#M186136</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-04T13:37:36Z</dc:date>
    </item>
  </channel>
</rss>

