<?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: SAS macro vars-Today,yesterday,same day in the prior month from yesterday in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476724#M122691</link>
    <description>&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1.Remove %sysfunc in your datastep code.&lt;/P&gt;
&lt;P&gt;2.intnx is not required in your code.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remove %sysfunc and intnx functions in the belowline of code&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;call symputx('beta', PUT(intnx('DAY',%SYSFUNC(&amp;amp;d_today.),-1), date9.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call symputx('beta', PUT(intnx('DAY',&amp;amp;d_today.,-1), date9.));&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;call symputx('beta', PUT(&amp;amp;d_today.-1, date9.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Above two lines of code gives the same result.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jul 2018 10:27:28 GMT</pubDate>
    <dc:creator>MadhuKorni</dc:creator>
    <dc:date>2018-07-10T10:27:28Z</dc:date>
    <item>
      <title>SAS macro vars-Today,yesterday,same day in the prior month from yesterday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476696#M122689</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I want to create 3 sas macro varaibles :Today,yesterday,same day in the prior month from yesterday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('Today', PUT(intnx('DAY',today(),0), date9.));&lt;BR /&gt;* Today;&lt;BR /&gt;call symputx('d_yesterday', put(today()-1, date9.));&lt;BR /&gt;* yesterday;&lt;BR /&gt;call symputx('beta', PUT(intnx('MONTH',today()-1,-1,'s'), date9.));&lt;BR /&gt;*last month same day of yesterday;&lt;BR /&gt;RUN;&lt;BR /&gt;%put &amp;amp;Today.;/*10JUL2018*/&lt;BR /&gt;%put &amp;amp;d_yesterday.;/*09JUL2018*/&lt;BR /&gt;%put &amp;amp;beta.;/*09JUN2018*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I did it in another way I received an error.&lt;/P&gt;&lt;P&gt;May someone tell me please why is the error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let d_today=%sysfunc(today());&lt;BR /&gt;%put &amp;amp;d_today.;&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('d_yesterday', PUT(intnx('DAY',&amp;amp;d_today.,-1), date9.));&lt;BR /&gt;* yesterday;&lt;BR /&gt;call symputx('beta', PUT(intnx('DAY',%SYSFUNC(&amp;amp;d_today.),-1), date9.));&lt;BR /&gt;*last month same day of yesterday;&lt;BR /&gt;RUN;&lt;BR /&gt;%put &amp;amp;d_yesterday.;&lt;BR /&gt;%put &amp;amp;beta.;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 09:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476696#M122689</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-07-10T09:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro vars-Today,yesterday,same day in the prior month from yesterday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476724#M122691</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1.Remove %sysfunc in your datastep code.&lt;/P&gt;
&lt;P&gt;2.intnx is not required in your code.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remove %sysfunc and intnx functions in the belowline of code&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;call symputx('beta', PUT(intnx('DAY',%SYSFUNC(&amp;amp;d_today.),-1), date9.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call symputx('beta', PUT(intnx('DAY',&amp;amp;d_today.,-1), date9.));&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;call symputx('beta', PUT(&amp;amp;d_today.-1, date9.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Above two lines of code gives the same result.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 10:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476724#M122691</guid>
      <dc:creator>MadhuKorni</dc:creator>
      <dc:date>2018-07-10T10:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro vars-Today,yesterday,same day in the prior month from yesterday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476795#M122725</link>
      <description>&lt;P&gt;Macro processing is just simple text replacement.&amp;nbsp; Look at what you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I did it in another way I received an error.&lt;/P&gt;
&lt;P&gt;May someone tell me please why is the error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let d_today=%sysfunc(today());&lt;BR /&gt;%put &amp;amp;d_today.;&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('beta', PUT(intnx('DAY',%SYSFUNC(&amp;amp;d_today.),-1), date9.));&lt;BR /&gt;RUN;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you set the macro variable D_TODAY to some 5 digit integer string representing the number of days since 1960. For today that is the string 21375.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;You then used it to as the name of the SAS function for %SYSFUNC() macro function to call.&amp;nbsp; There is no function named 21375. And anyway you left off the required () after the function name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476795#M122725</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-10T13:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro vars-Today,yesterday,same day in the prior month from yesterday</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476802#M122729</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create 3 sas macro varaibles :Today,yesterday,same day in the prior month from yesterday.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('Today', PUT(intnx('DAY',today(),0), date9.));&lt;BR /&gt;* Today;&lt;BR /&gt;call symputx('d_yesterday', put(today()-1, date9.));&lt;BR /&gt;* yesterday;&lt;BR /&gt;call symputx('beta', PUT(intnx('MONTH',today()-1,-1,'s'), date9.));&lt;BR /&gt;*last month same day of yesterday;&lt;BR /&gt;RUN;&lt;BR /&gt;%put &amp;amp;Today.;/*10JUL2018*/&lt;BR /&gt;%put &amp;amp;d_yesterday.;/*09JUL2018*/&lt;BR /&gt;%put &amp;amp;beta.;/*09JUN2018*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I did it in another way I received an error.&lt;/P&gt;
&lt;P&gt;May someone tell me please why is the error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let d_today=%sysfunc(today());&lt;BR /&gt;%put &amp;amp;d_today.;&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('d_yesterday', PUT(intnx('DAY',&amp;amp;d_today.,-1), date9.));&lt;BR /&gt;* yesterday;&lt;BR /&gt;call symputx('beta', PUT(intnx('DAY',%SYSFUNC(&amp;amp;d_today.),-1), date9.));&lt;BR /&gt;*last month same day of yesterday;&lt;BR /&gt;RUN;&lt;BR /&gt;%put &amp;amp;d_yesterday.;&lt;BR /&gt;%put &amp;amp;beta.;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From now on, could you please post your code in the proper format, by clicking on the running man icon, then pasting your code into the window that opens? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-vars-Today-yesterday-same-day-in-the-prior-month-from/m-p/476802#M122729</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-10T13:35:20Z</dc:date>
    </item>
  </channel>
</rss>

