<?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: Sysfunc with intnx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725128#M225193</link>
    <description>&lt;P&gt;Everything is text to the macro processor.&amp;nbsp; So if you add quotes around constant text strings they quotes are part of the string.&lt;/P&gt;
&lt;P&gt;Each SAS function you want to use in macro code needs to be wrapped in its own %SYSFUNC() macro function call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let period=%sysfunc(intnx(month,%sysfunc(date()),-1),yymmn6.);
data TEST;
  set LIB.MY_TABLE_&amp;amp;period ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Mar 2021 13:44:01 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-03-10T13:44:01Z</dc:date>
    <item>
      <title>Sysfunc with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725125#M225190</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to refer to a specific table from the previous month. The tables have the following name structure: MY_TABLE_&amp;amp;DATE (in&amp;nbsp;yymmn6. format) like LIB.MY_TABLE_202102 or LIB.MY_TABLE_202103 etc&lt;/P&gt;
&lt;P&gt;Below is code that I've already done but It doesn't work&lt;/P&gt;
&lt;P&gt;%let period=intnx("month",date(),-1,"same");&lt;BR /&gt;data TEST;&lt;BR /&gt;set LIB.MY_TABLE_%sysfunc(&amp;amp;period.,yymmn6.);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 13:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725125#M225190</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-03-10T13:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sysfunc with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725126#M225191</link>
      <description>&lt;P&gt;No quotes or double-quotes inside of %SYSFUNC, these are not needed and wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let period=%sysfunc(intnx(month,date(),-1,same));
%let period=%sysfunc(putn(&amp;amp;period,yymmn6.));
data TEST;
    set LIB.MY_TABLE_&amp;amp;period;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Mar 2021 13:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725126#M225191</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-10T13:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sysfunc with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725128#M225193</link>
      <description>&lt;P&gt;Everything is text to the macro processor.&amp;nbsp; So if you add quotes around constant text strings they quotes are part of the string.&lt;/P&gt;
&lt;P&gt;Each SAS function you want to use in macro code needs to be wrapped in its own %SYSFUNC() macro function call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let period=%sysfunc(intnx(month,%sysfunc(date()),-1),yymmn6.);
data TEST;
  set LIB.MY_TABLE_&amp;amp;period ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Mar 2021 13:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725128#M225193</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-10T13:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sysfunc with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725130#M225195</link>
      <description>Still got errors&lt;BR /&gt;ERROR: Required operator not found in expression: date() &lt;BR /&gt;ERROR: Argument 2 to function INTNX referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number.&lt;BR /&gt;ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list.  Execution of %SYSCALL statement or %SYSFUNC or %QSYSFUNC function reference is terminated.</description>
      <pubDate>Wed, 10 Mar 2021 13:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725130#M225195</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-03-10T13:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sysfunc with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725132#M225196</link>
      <description>Thanks Tom, it works fine. I get it now</description>
      <pubDate>Wed, 10 Mar 2021 13:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc-with-intnx/m-p/725132#M225196</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-03-10T13:50:03Z</dc:date>
    </item>
  </channel>
</rss>

