<?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 function in a macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312991#M67945</link>
    <description>&lt;P&gt;Ah,&lt;/P&gt;
&lt;P&gt;ok thanks!!&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2016 09:17:14 GMT</pubDate>
    <dc:creator>Rakeon</dc:creator>
    <dc:date>2016-11-21T09:17:14Z</dc:date>
    <item>
      <title>intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312979#M67938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;use the intnx function in a macro variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let start &amp;nbsp; = %sysfunc(intnx(MONTH,%sysfunc(today()),-1,SAME),DDMMYYS10.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It, works...but I would like to know if is there another way to do the same operation?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 08:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312979#M67938</guid>
      <dc:creator>Rakeon</dc:creator>
      <dc:date>2016-11-21T08:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312981#M67939</link>
      <description>&lt;P&gt;My preferrred method is to use a data _null_ step and call symput:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
start = intnx('MONTH',today(),-1,'SAME');
call symput('start',put(start,DDMMYYS10.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So all the calculations are done in pure data step language and easier to read, because you don't have to care for all the %sysfunc's.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 08:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312981#M67939</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-21T08:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312982#M67940</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;but I need to use it outside the data step, because I write the main program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 08:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312982#M67940</guid>
      <dc:creator>Rakeon</dc:creator>
      <dc:date>2016-11-21T08:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312984#M67941</link>
      <description>&lt;P&gt;My data _null_ step delivers eactly the same result that your %let does.&lt;/P&gt;
&lt;P&gt;Keep this in mind:&lt;/P&gt;
&lt;P&gt;if you write a %let in a data step, it will &lt;U&gt;not&lt;/U&gt; be executed in the data step (!!!). Instead it will be executed upon the fetching of the code, so logically it is the same as if you wrote it immediately &lt;U&gt;before&lt;/U&gt; the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, what do you mean by "main program"?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 08:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312984#M67941</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-21T08:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312987#M67943</link>
      <description>&lt;P&gt;Yes,&lt;/P&gt;
&lt;P&gt;thank for you answer and for your help,&lt;/P&gt;
&lt;P&gt;for me,&lt;/P&gt;
&lt;P&gt;the main Program is a file where I put all important macro variable and the libname for the path of several programs *.sas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 09:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312987#M67943</guid>
      <dc:creator>Rakeon</dc:creator>
      <dc:date>2016-11-21T09:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312988#M67944</link>
      <description>&lt;P&gt;You can use my data step in that main program.&lt;/P&gt;
&lt;P&gt;I guess you will %include that in all your programs or autoexec's. Data steps in %include'd files will work just as if they were written directly in the calling program.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 09:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312988#M67944</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-21T09:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312991#M67945</link>
      <description>&lt;P&gt;Ah,&lt;/P&gt;
&lt;P&gt;ok thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 09:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312991#M67945</guid>
      <dc:creator>Rakeon</dc:creator>
      <dc:date>2016-11-21T09:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: intnx function in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312994#M67947</link>
      <description>&lt;P&gt;To further elaborate:&lt;/P&gt;
&lt;P&gt;%include is a macro (pre-processor) statement. As soon as it is encountered, the included file is read and placed in the input buffer of the SAS interpreter in place of the %include statement. So you can use any SAS code in a file that is to be %include'd.&lt;/P&gt;
&lt;P&gt;It's just that, after the include is performed, the resulting code needs to be syntactically correct and make sense.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 09:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx-function-in-a-macro-variable/m-p/312994#M67947</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-21T09:32:01Z</dc:date>
    </item>
  </channel>
</rss>

