<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912968#M359863</link>
    <description>&lt;P&gt;When code doesn't work, please show us the ENTIRE log (not just the error messages)&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 11:25:03 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-01-25T11:25:03Z</dc:date>
    <item>
      <title>intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912962#M359859</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data testdata;
input cost_mth $9. monyyyy $10.;
datalines;
20NOV2023 NOV2023
1NOV2023 DEC2023
30NOV2023 DEC2023
;
RUN;

proc print data=testdata;run;

* cost_mth=21JAN2009 MONYYYY=DEC2006

proc sql;
create table default_cnt as 
select
intnx('month',cost_mth,0,'e') as default_mth format=date9. 
from testdata;
quit;

proc print data=default_cnt;
run;

DATA result;
set testdata;
test1=PUT(monyyyy,MONYY7.);
test2=PUT(A.default_mth+1, MONYY7.);
run;


proc print data=result;
run;
&lt;/PRE&gt;
&lt;P&gt;why doesnt my code works, it says out of proper order for the intnx statement&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;please helo&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 11:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912962#M359859</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-01-25T11:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912968#M359863</link>
      <description>&lt;P&gt;When code doesn't work, please show us the ENTIRE log (not just the error messages)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 11:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912968#M359863</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-25T11:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912973#M359865</link>
      <description>&lt;P&gt;There are a few changes needed for your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would code the first DATA step to actually read the values as dates and not as character value, like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testdata;
input cost_mth : date9. monyyyy : monyy7.;
format cost_mth monyyyy date9.;
datalines;
20NOV2023 NOV2023
1NOV2023 DEC2023
30NOV2023 DEC2023
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Second you are missing the ";" in you comment statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your last DATA step you read the data from the first DATA step, this data set is missing the&amp;nbsp;default_mth variable (in the DATA step you just use the name of a variable, so A.default_mth will not work). Your SQL creates a table with one variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 12:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intnx/m-p/912973#M359865</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2024-01-25T12:37:26Z</dc:date>
    </item>
  </channel>
</rss>

