<?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 Error in calling  INTNX function from %sysfunc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346760#M79996</link>
    <description>&lt;P&gt;I am new to sas programs...can someone help me solving this issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; drop='31-MAR-2016'; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; drop1=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(month,&amp;amp;drop.d,6,s),date9.);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I am trying to get the date&amp;nbsp;6 months prior to this date..ie..31-OCT-2015..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Drop1 is not working..Throwing some oracle error..I am using Proc Sql..oracle connection.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ORACLE prepare error: ORA-00907: missing right parenthesis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New"&gt;Drop works fine.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks for the help.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2017 17:03:24 GMT</pubDate>
    <dc:creator>Kalai2008</dc:creator>
    <dc:date>2017-04-03T17:03:24Z</dc:date>
    <item>
      <title>Error in calling  INTNX function from %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346760#M79996</link>
      <description>&lt;P&gt;I am new to sas programs...can someone help me solving this issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; drop='31-MAR-2016'; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; drop1=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(month,&amp;amp;drop.d,6,s),date9.);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I am trying to get the date&amp;nbsp;6 months prior to this date..ie..31-OCT-2015..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Drop1 is not working..Throwing some oracle error..I am using Proc Sql..oracle connection.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ORACLE prepare error: ORA-00907: missing right parenthesis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New"&gt;Drop works fine.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks for the help.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 17:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346760#M79996</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-04-03T17:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error in calling  INTNX function from %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346769#M79997</link>
      <description>&lt;P&gt;Just from what&amp;nbsp; you have shown us, you need to realize that you specified DATE9 rather than DATE11.&amp;nbsp; That means you will get 31OCT2015 rather than 31-OCT-2015 as the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely, the error comes from your Oracle selection.&amp;nbsp; For example, you might be using this representation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'&amp;amp;drop1.'d&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro variable references within single quotes do not resolve.&amp;nbsp; If your version of Oracle SQL permits double quotes, you could use them:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&amp;amp;drop1."d&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could switch to a more complex expression that uses single quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%unquote(%str(%'&amp;amp;drop1.%'d))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, without seeing the actual code you are using later, it could be something else entirely as well.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 17:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346769#M79997</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-03T17:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error in calling  INTNX function from %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346785#M80003</link>
      <description>&lt;P&gt;Thank you for the quick reply.&lt;BR /&gt;The actual program code is very simple.&lt;BR /&gt;proc sql;&lt;BR /&gt;&amp;nbsp;connect to oracle(user=&amp;amp;userid. password=&amp;amp;passwd. path=**** preserve_comments);&lt;BR /&gt;&amp;nbsp;create table y.Cases as select * from connection to oracle&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;WITH ids AS (&lt;/P&gt;&lt;P&gt;select&amp;nbsp; *&lt;/P&gt;&lt;P&gt;..from ....&lt;/P&gt;&lt;P&gt;where.....&lt;BR /&gt;AND trunc(c.date) =&amp;amp;drop1&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;select * from ids&lt;BR /&gt;&amp;nbsp;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;disconnect from oracle;&lt;BR /&gt;&amp;nbsp;quit;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let drop='31-MAR-2017';&lt;BR /&gt;%let drop1=%sysfunc(intnx(month,&amp;amp;drop.d,-6,e),date11.);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried changing the date9 to date11.&lt;/P&gt;&lt;P&gt;When I tried this&amp;nbsp; '&amp;amp;sdate1.'&lt;BR /&gt;Oracle error says "ERROR: ORACLE execute error: ORA-01858: a non-numeric character was found where a numeric was expected."&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When I tried this&amp;nbsp;--- &amp;amp;sdate1.&lt;BR /&gt;ERROR: ORACLE prepare error: ORA-00904: "SEP": invalid identifier&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I also tried several put statements in the log&lt;BR /&gt;%put &amp;amp;sdate1.;&lt;BR /&gt;30-SEP-2016&lt;BR /&gt;&amp;nbsp; %put &amp;amp;sdate1.d;&lt;BR /&gt;30-SEP-2016d&lt;BR /&gt;&amp;nbsp;%put '&amp;amp;sdate1'.d;&lt;BR /&gt;'&amp;amp;sdate1'.d&lt;BR /&gt;&amp;nbsp; %put '&amp;amp;sdate1.d';&lt;BR /&gt;'&amp;amp;sdate1.d'&lt;BR /&gt;&amp;nbsp; %put '&amp;amp;sdate1.'d;&lt;BR /&gt;'&amp;amp;sdate1.'d&lt;BR /&gt;&amp;nbsp;%put "&amp;amp;sdate1.d";&lt;BR /&gt;"30-SEP-2016d"&lt;BR /&gt;&amp;nbsp;%put "&amp;amp;sdate1.";&lt;BR /&gt;"30-SEP-2016"&lt;BR /&gt;&amp;nbsp; %put "&amp;amp;sdate1.d";&lt;BR /&gt;"30-SEP-2016d"&lt;BR /&gt;&amp;nbsp;%put "&amp;amp;sdate1."d;&lt;BR /&gt;"30-SEP-2016"d&lt;BR /&gt;&amp;nbsp; %put '&amp;amp;sdate1.';&lt;BR /&gt;'&amp;amp;sdate1.'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks for the reply.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 17:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346785#M80003</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-04-03T17:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error in calling  INTNX function from %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346788#M80004</link>
      <description>&lt;P&gt;Does the syntax you have in your macro variable DROP work with ORACLE?&lt;/P&gt;
&lt;P&gt;If so then make DROP1 using the same syntax.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let drop='31-MAR-2017';
%let drop1=%unquote(%str(%')%sysfunc(intnx(month,&amp;amp;drop.d,-6,e),date11)%str(%'));
%put &amp;amp;=drop &amp;amp;=drop1;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DROP='31-MAR-2017' DROP1='30-SEP-2016'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 18:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346788#M80004</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-04-03T18:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error in calling  INTNX function from %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346790#M80005</link>
      <description>&lt;P&gt;Thank you so much Tom..Awesome...it worked...!!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 18:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-calling-INTNX-function-from-sysfunc/m-p/346790#M80005</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-04-03T18:12:08Z</dc:date>
    </item>
  </channel>
</rss>

