<?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 INTNX Error in macro code - number not recognized as number in function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891377#M352139</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to macros and have some very simple code which seems to be working. I tested it by printing out the dates and dates2 tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;CODE&lt;/U&gt;&lt;/P&gt;&lt;P&gt;%MACRO createtables (row, seeddate);&lt;/P&gt;&lt;P&gt;data dates;&lt;BR /&gt;runmonth = &amp;amp;seeddate.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;createtables (row=1, seeddate=mdy(2,1,2022));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dates2;&lt;BR /&gt;set dates;&lt;BR /&gt;testa = put(runmonth,yymmdd10.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wendydawn_0-1693246992887.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87227i7969FF17A7203277/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wendydawn_0-1693246992887.png" alt="wendydawn_0-1693246992887.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I take the next step using rundate in INTNX, I get an error that rundate is not a number. What am I doing wrong?? Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&lt;U&gt;CODE&lt;/U&gt;&lt;/P&gt;&lt;P&gt;%MACRO createtables (row, seeddate);&lt;/P&gt;&lt;P&gt;data dates;&lt;BR /&gt;runmonth = &amp;amp;seeddate.;&lt;BR /&gt;startdate = %sysfunc(intnx('month',runmonth,-12,'B'));&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%createtables (row=1, seeddate=mdy(2,1,2022));&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wendydawn_1-1693247166444.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87228i3E32310A843DC12A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wendydawn_1-1693247166444.png" alt="wendydawn_1-1693247166444.png" /&gt;&lt;/span&gt;&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, 28 Aug 2023 18:26:51 GMT</pubDate>
    <dc:creator>wendydawn</dc:creator>
    <dc:date>2023-08-28T18:26:51Z</dc:date>
    <item>
      <title>INTNX Error in macro code - number not recognized as number in function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891377#M352139</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to macros and have some very simple code which seems to be working. I tested it by printing out the dates and dates2 tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;CODE&lt;/U&gt;&lt;/P&gt;&lt;P&gt;%MACRO createtables (row, seeddate);&lt;/P&gt;&lt;P&gt;data dates;&lt;BR /&gt;runmonth = &amp;amp;seeddate.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;createtables (row=1, seeddate=mdy(2,1,2022));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dates2;&lt;BR /&gt;set dates;&lt;BR /&gt;testa = put(runmonth,yymmdd10.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wendydawn_0-1693246992887.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87227i7969FF17A7203277/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wendydawn_0-1693246992887.png" alt="wendydawn_0-1693246992887.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I take the next step using rundate in INTNX, I get an error that rundate is not a number. What am I doing wrong?? Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&lt;U&gt;CODE&lt;/U&gt;&lt;/P&gt;&lt;P&gt;%MACRO createtables (row, seeddate);&lt;/P&gt;&lt;P&gt;data dates;&lt;BR /&gt;runmonth = &amp;amp;seeddate.;&lt;BR /&gt;startdate = %sysfunc(intnx('month',runmonth,-12,'B'));&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%createtables (row=1, seeddate=mdy(2,1,2022));&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wendydawn_1-1693247166444.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87228i3E32310A843DC12A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wendydawn_1-1693247166444.png" alt="wendydawn_1-1693247166444.png" /&gt;&lt;/span&gt;&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, 28 Aug 2023 18:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891377#M352139</guid>
      <dc:creator>wendydawn</dc:creator>
      <dc:date>2023-08-28T18:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX Error in macro code - number not recognized as number in function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891383#M352143</link>
      <description>&lt;P&gt;No need for %sysfunc to call a data step function inside a data step. Just use the data step function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO createtables (row, seeddate);
    data dates;
        runmonth = &amp;amp;seeddate.;
        startdate = intnx('month',runmonth,-12,'B');
    run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify this code even further&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro createtables (row, seeddate);
    data dates;
        startdate = intnx('month',&amp;amp;seeddate,-12,'b');
    run;
%mend;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you MUST use %sysfunc, do not put quotes around month and do not put quotes around B. But even so, you can't use %sysfunc here because it cannot access any data step variables, in this case it cannot access data step variable RUNMONTH.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 19:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891383#M352143</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-28T19:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX Error in macro code - number not recognized as number in function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891385#M352145</link>
      <description>&lt;P&gt;Thank you so much! I really appreciate your response. I feel like I tried everything but the simplest solution.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":upside_down_face:"&gt;🙃&lt;/span&gt;&amp;nbsp;I still have a lot to learn about data steps vs other types of steps.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 19:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891385#M352145</guid>
      <dc:creator>wendydawn</dc:creator>
      <dc:date>2023-08-28T19:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX Error in macro code - number not recognized as number in function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891389#M352149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431445"&gt;@wendydawn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much! I really appreciate your response. I feel like I tried everything but the simplest solution.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":upside_down_face:"&gt;🙃&lt;/span&gt;&amp;nbsp;I still have a lot to learn about data steps vs other types of steps.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to learn how to use data steps first.&amp;nbsp; Do not bother trying to learn how to use code to create code (the macro language) until you know how to create the code yourself.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 19:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-Error-in-macro-code-number-not-recognized-as-number-in/m-p/891389#M352149</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-28T19:18:03Z</dc:date>
    </item>
  </channel>
</rss>

