<?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: How do use a dataset variable with INTNX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329412#M73691</link>
    <description>&lt;P&gt;It depends on whether XXX takes on only positive values, and whether you want to move back or move forward.&amp;nbsp; At any rate, this should probably be the replacement for DATE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-1*xxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if that moves&amp;nbsp;you in the wrong direction, use xxx instead.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2017 13:54:37 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-02-02T13:54:37Z</dc:date>
    <item>
      <title>How do use a dataset variable with INTNX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329407#M73688</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am trying to use a variable from a data sent in an INTNX statement to create a new variable in the same dataset. &amp;nbsp;I would like to use the variable 'XXX' to replace the '-12' in the intnx statement below. &amp;nbsp; XXX is a numeric and represents a number of months, i.e 12 months, 18 months, 255 months, etc. &amp;nbsp;My goal is to create a new date variable, which =&amp;nbsp;'date' - XXX months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As ever, thanks in advnce to all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table test2 as&lt;BR /&gt;select extdate,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Date,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intnx('Month',date,-12,'s') format=date9. as&amp;nbsp;new_var&lt;BR /&gt;from test;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 13:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329407#M73688</guid>
      <dc:creator>pandhandj</dc:creator>
      <dc:date>2017-02-02T13:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do use a dataset variable with INTNX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329412#M73691</link>
      <description>&lt;P&gt;It depends on whether XXX takes on only positive values, and whether you want to move back or move forward.&amp;nbsp; At any rate, this should probably be the replacement for DATE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-1*xxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if that moves&amp;nbsp;you in the wrong direction, use xxx instead.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 13:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329412#M73691</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-02T13:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do use a dataset variable with INTNX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329421#M73697</link>
      <description>&lt;P&gt;Hi Astounding, thanks for getting backto me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont think I have explained myself well...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Date' is the date i wish to count back in time from.&lt;/P&gt;&lt;P&gt;'XXX' &amp;nbsp;is a variable - the number of months i want to count back from 'Date'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do i get the variable 'XXX' to replace the '-12' in this -&amp;nbsp;intnx('Month',date,-12,'s') format=date9. as test&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does that make sense?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 14:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329421#M73697</guid>
      <dc:creator>pandhandj</dc:creator>
      <dc:date>2017-02-02T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do use a dataset variable with INTNX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329424#M73700</link>
      <description>&lt;P&gt;You did fine.&amp;nbsp; That was my mistake.&amp;nbsp; Replace -12 with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-1 * xxx&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 14:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329424#M73700</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-02T14:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do use a dataset variable with INTNX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329435#M73704</link>
      <description>&lt;P&gt;thanks Astounding, i appreciate your help.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 14:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-use-a-dataset-variable-with-INTNX/m-p/329435#M73704</guid>
      <dc:creator>pandhandj</dc:creator>
      <dc:date>2017-02-02T14:33:37Z</dc:date>
    </item>
  </channel>
</rss>

