<?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 using macro variables for INTNX function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/using-macro-variables-for-INTNX-function/m-p/31590#M7522</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing an ampersand in the first %LET statement. &lt;/P&gt;&lt;P&gt;Also you do not use quotes around character strings in SYSFUNC calls.&lt;/P&gt;&lt;P&gt;What format do you want the NEWDAY variable?&amp;nbsp; &lt;/P&gt;&lt;P&gt;You are currently asking for an integer (number of days since 1/1/1960).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you meant to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let dateend=&amp;amp;sysdate9.;&lt;/P&gt;&lt;P&gt;%let newday=%sysfunc(intnx(day,"&amp;amp;dateend"d,-1),date9.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or better still if you are like me and sometimes leave SAS running interactively for past midnight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let dateend=%sysfunc(today(),date9.);&lt;/P&gt;&lt;P&gt;%let newday=%sysfunc(intnx(day,"&amp;amp;dateend"d,-1),date9.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Oct 2011 00:25:16 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2011-10-20T00:25:16Z</dc:date>
    <item>
      <title>using macro variables for INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-macro-variables-for-INTNX-function/m-p/31589#M7521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAS users&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; dateend=SYSDATE9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; newday=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(INTNX('day',"&amp;amp;dateend"d,-1));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set the first macro variable called &lt;EM&gt;dateend&lt;/EM&gt; to be the current date, then&lt;/P&gt;&lt;P&gt;I would like to set the macro variable called &lt;EM&gt;newday&lt;/EM&gt; to be the previous day.&lt;/P&gt;&lt;P&gt;So for example, If I ran this now, I would expect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dateend=20OCT2011&lt;/P&gt;&lt;P&gt;newday=19OCT2011.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note, I am trying to run these codes outside %macro-%mend block, but as just single lines, and they are under any datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment, SAS is not happy with what I am doing and I have tried the second line without %SYSFUNC but it still wouldn't work.&lt;/P&gt;&lt;P&gt;Would anyone have any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 23:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-macro-variables-for-INTNX-function/m-p/31589#M7521</guid>
      <dc:creator>willy0625</dc:creator>
      <dc:date>2011-10-19T23:42:33Z</dc:date>
    </item>
    <item>
      <title>using macro variables for INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-macro-variables-for-INTNX-function/m-p/31590#M7522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing an ampersand in the first %LET statement. &lt;/P&gt;&lt;P&gt;Also you do not use quotes around character strings in SYSFUNC calls.&lt;/P&gt;&lt;P&gt;What format do you want the NEWDAY variable?&amp;nbsp; &lt;/P&gt;&lt;P&gt;You are currently asking for an integer (number of days since 1/1/1960).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you meant to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let dateend=&amp;amp;sysdate9.;&lt;/P&gt;&lt;P&gt;%let newday=%sysfunc(intnx(day,"&amp;amp;dateend"d,-1),date9.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or better still if you are like me and sometimes leave SAS running interactively for past midnight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let dateend=%sysfunc(today(),date9.);&lt;/P&gt;&lt;P&gt;%let newday=%sysfunc(intnx(day,"&amp;amp;dateend"d,-1),date9.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 00:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-macro-variables-for-INTNX-function/m-p/31590#M7522</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-20T00:25:16Z</dc:date>
    </item>
  </channel>
</rss>

